devices

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Wildcard = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Rule
	Path     string      `json:"path"`
	FileMode os.FileMode `json:"file_mode"`
	Uid      uint32      `json:"uid"`
	Gid      uint32      `json:"gid"`
}

type Permissions

type Permissions string

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) Mkdev

func (d *Rule) Mkdev() (uint64, error)

type ThrottleDevice

type ThrottleDevice struct {
	Path string
	Rate uint64
}

ThrottleDevice is a structure that holds device:rate_per_second pair

func (*ThrottleDevice) String

func (t *ThrottleDevice) String() string

type Type

type Type rune
const (
	WildcardDevice Type = 'a'
	BlockDevice    Type = 'b'
	CharDevice     Type = 'c' // or 'u'
	FifoDevice     Type = 'p'
)

func (Type) CanCgroup

func (t Type) CanCgroup() bool

func (Type) CanMknod

func (t Type) CanMknod() bool

func (Type) IsValid

func (t Type) IsValid() bool

type WeightDevice

type WeightDevice struct {
	Path   string
	Weight uint16
}

func (*WeightDevice) String

func (w *WeightDevice) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL