Documentation ¶
Index ¶
- func BecomeProcessGroupLeader() int
- func Contains(items []string, ele string) bool
- func CreateDevices() error
- func FileExists(name string) bool
- func KillProcess(pid int) error
- func Mkdev(major, minor int) int
- func Mknod(path string, mode uint32, dev int) error
- func UpdateEnv(env []string)
- func ValidateEnv(val string) (string, error)
- func ValidateIPAddress(val string) (string, error)
- type ListOpts
- func (opts *ListOpts) Delete(key string)
- func (opts *ListOpts) Get(key string) bool
- func (opts *ListOpts) GetAll() []string
- func (opts *ListOpts) GetAllOrEmpty() []string
- func (opts *ListOpts) GetMap() map[string]struct{}
- func (opts *ListOpts) Len() int
- func (opts *ListOpts) Set(value string) error
- func (opts *ListOpts) String() string
- func (opts *ListOpts) Type() string
- func (opts *ListOpts) WithValidator(validator ValidatorFctType) *ListOpts
- type MemBytes
- type MemSwapBytes
- type ValidatorFctListType
- type ValidatorFctType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BecomeProcessGroupLeader ¶
func BecomeProcessGroupLeader() int
func CreateDevices ¶
func CreateDevices() error
func FileExists ¶
func KillProcess ¶
func Mkdev ¶
Mkdev is used to build the value of linux devices (in /dev/) which specifies major and minor number of the newly created device special file. Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, then the top 12 bits of the minor.
func Mknod ¶
Mknod creates a filesystem node (file, device special file or named pipe) named path with attributes specified by mode and dev.
func ValidateEnv ¶
ValidateEnv validates an environment variable and returns it. If no value is specified, it obtains its value from the current environment
As on ParseEnvFile and related to #16585, environment variable names are not validated, and it's up to the application inside the container to validate them or not.
The only validation here is to check if name is empty, per #25099
func ValidateIPAddress ¶
ValidateIPAddress validates an Ip address.
Types ¶
type ListOpts ¶
type ListOpts struct {
// contains filtered or unexported fields
}
ListOpts holds a list of values and a validation function.
func NewListOpts ¶
func NewListOpts(validator ValidatorFctType) ListOpts
NewListOpts creates a new ListOpts with the specified validator.
func NewListOptsRef ¶
func NewListOptsRef(values *[]string, validator ValidatorFctType) *ListOpts
NewListOptsRef creates a new ListOpts with the specified values and validator.
func (*ListOpts) GetAllOrEmpty ¶
GetAllOrEmpty returns the values of the slice or an empty slice when there are no values.
func (*ListOpts) GetMap ¶
GetMap returns the content of values in a map in order to avoid duplicates.
func (*ListOpts) WithValidator ¶
func (opts *ListOpts) WithValidator(validator ValidatorFctType) *ListOpts
WithValidator returns the ListOpts with validator set.
type MemBytes ¶
type MemBytes int64
MemBytes is a type for human readable memory bytes (like 128M, 2g, etc)
type MemSwapBytes ¶
type MemSwapBytes int64
MemSwapBytes is a type for human readable memory bytes (like 128M, 2g, etc). It differs from MemBytes in that -1 is valid and the default.
func (*MemSwapBytes) Set ¶
func (m *MemSwapBytes) Set(value string) error
Set sets the value of the MemSwapBytes by passing a string
func (*MemSwapBytes) String ¶
func (m *MemSwapBytes) String() string
type ValidatorFctListType ¶
ValidatorFctListType defines a validator function that returns a validated list of string and/or an error
type ValidatorFctType ¶
ValidatorFctType defines a validator function that returns a validated string and/or an error.