sysctl

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 5 Imported by: ? modules, 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

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 IntPair

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

IntPair represents a sysconfig with a single line with two integer values such as 1234 5678

func NewIntPair

func NewIntPair(procRoot, sysctl string, cacheFor time.Duration) *IntPair

NewIntPair creates a new sysctl.IntPair an IntPair is a sysctl that has two space-separated integer values

`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 (*IntPair) Get

func (i *IntPair) Get() (int, 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