Documentation ¶
Overview ¶
Package procfs provides function to manager kernel command line arguments.
Index ¶
- type AppendAllOption
- type AppendAllOptions
- type Cmdline
- func (c *Cmdline) Append(k, v string)
- func (c *Cmdline) AppendAll(args []string, opts ...AppendAllOption) error
- func (c *Cmdline) Bytes() []byte
- func (c *Cmdline) Delete(v *Parameter)
- func (c *Cmdline) DeleteAll(k string)
- func (c *Cmdline) Get(k string) (value *Parameter)
- func (c *Cmdline) Set(k string, v *Parameter)
- func (c *Cmdline) SetAll(args []string)
- type Key
- type Parameter
- type Parameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendAllOption ¶
type AppendAllOption func(*AppendAllOptions)
AppendAllOption is a functional option for AppendAll.
func WithDeleteNegatedArgs ¶ added in v0.1.2
func WithDeleteNegatedArgs() AppendAllOption
WithDeleteNegatedArgs specifies whether kernel arguments that starts with `-` should be removed with AppendAll.
func WithOverwriteArgs ¶
func WithOverwriteArgs(args ...string) AppendAllOption
WithOverwriteArgs specifies kernel arguments which should be overwritten with AppendAll.
type AppendAllOptions ¶
AppendAllOptions provides additional options for AppendAll.
type Cmdline ¶
type Cmdline struct { Parameters sync.Mutex }
Cmdline represents a set of kernel parameters.
func NewCmdline ¶
NewCmdline initializes and returns a representation of the cmdline values specified by `parameters`.
func ProcCmdline ¶
func ProcCmdline() *Cmdline
ProcCmdline returns a representation of /proc/cmdline.
func (*Cmdline) AppendAll ¶
func (c *Cmdline) AppendAll(args []string, opts ...AppendAllOption) error
AppendAll appends a set of kernel parameters.
func (*Cmdline) DeleteAll ¶ added in v0.1.2
DeleteAll deletes all occurrences of the kernel parameter.
type Parameter ¶
type Parameter struct {
// contains filtered or unexported fields
}
Parameter represents a value in a kernel parameter key-value pair.
func NewParameter ¶
NewParameter initializes and returns a Parameter.
func (*Parameter) First ¶
First attempts to return the first string of a value's internal representation.
type Parameters ¶
type Parameters []*Parameter
Parameters represents /proc/cmdline.
func (Parameters) String ¶
func (p Parameters) String() string
String returns a string representation of all parameters.
func (Parameters) Strings ¶
func (p Parameters) Strings() []string
Strings returns a string representation of all parameters.