sysctl

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int

type Int struct {
	// contains filtered or unexported fields
}

Int represents an int sysctl

func NewInt

func NewInt(procRoot, sysctl string, cacheFor time.Duration) *Int

NewInt creates a new sysctl.Int

`procRoot` points to the procfs root, e.g. /proc `sysctl` is the path for the sysctl, e.g. /proc/sys/<sysctl> `cacheFor` caches the sysctl's value for the given time duration; `0` disables caching

func (*Int) Get

func (i *Int) Get() (int, error)

Get gets the current value of the sysctl

type String

type String struct {
	// contains filtered or unexported fields
}

String represents a string sysctl

func NewString

func NewString(procRoot, sysctl string, cacheFor time.Duration) *String

NewString creates a new sysctl.String

`procRoot` points to the procfs root, e.g. /proc `sysctl` is the path for the sysctl, e.g. /proc/sys/<sysctl> `cacheFor` caches the sysctl's value for the given time duration; `0` disables caching

func (*String) Get

func (s *String) Get() (string, error)

Get gets the current value of the sysctl

Jump to

Keyboard shortcuts

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