package config
import "github.com/opencontainers/cgroups/devices/config"
Index ¶
- Constants
- type Device
- type Permissions
- func (p Permissions) Difference(o Permissions) Permissions
- func (p Permissions) Intersection(o Permissions) Permissions
- func (p Permissions) IsEmpty() bool
- func (p Permissions) IsValid() bool
- func (p Permissions) Union(o Permissions) Permissions
- type Rule
- type Type
Constants ¶
const (
Wildcard = -1
)
Types ¶
type Device ¶
type Device struct { Rule // Path to the device. Path string `json:"path"` // FileMode permission bits for the device. FileMode os.FileMode `json:"file_mode"` // Uid of the device. Uid uint32 `json:"uid"` // Gid of the device. Gid uint32 `json:"gid"` }
type Permissions ¶
type Permissions string
Permissions is a cgroupv1-style string to represent device access. It has to be a string for backward compatibility reasons, hence why it has methods to do set operations.
func (Permissions) Difference ¶
func (p Permissions) Difference(o Permissions) Permissions
Difference returns the set difference of the two sets of Permissions. In set notation, A.Difference(B) gives you A\B.
func (Permissions) Intersection ¶
func (p Permissions) Intersection(o Permissions) Permissions
Intersection computes the intersection of the two sets of Permissions.
func (Permissions) IsEmpty ¶
func (p Permissions) IsEmpty() bool
IsEmpty returns whether the set of permissions in a Permissions is empty.
func (Permissions) IsValid ¶
func (p Permissions) IsValid() bool
IsValid returns whether the set of permissions is a subset of valid permissions (namely, {r,w,m}).
func (Permissions) Union ¶
func (p Permissions) Union(o Permissions) Permissions
Union returns the union of the two sets of Permissions.
type Rule ¶
type Rule struct { // Type of device ('c' for char, 'b' for block). If set to 'a', this rule // acts as a wildcard and all fields other than Allow are ignored. Type Type `json:"type"` // Major is the device's major number. Major int64 `json:"major"` // Minor is the device's minor number. Minor int64 `json:"minor"` // Permissions is the set of permissions that this rule applies to (in the // cgroupv1 format -- any combination of "rwm"). Permissions Permissions `json:"permissions"` // Allow specifies whether this rule is allowed. Allow bool `json:"allow"` }
func (*Rule) CgroupString ¶
func (*Rule) Mkdev ¶
type Type ¶
type Type rune
const ( WildcardDevice Type = 'a' BlockDevice Type = 'b' CharDevice Type = 'c' // or 'u' FifoDevice Type = 'p' )
func (Type) CanCgroup ¶
func (Type) CanMknod ¶
func (Type) IsValid ¶
Source Files ¶
- Version
- v0.0.1 (latest)
- Published
- Feb 28, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 month ago –
Tools for package owners.