sysctl

package
v0.0.0-...-41dbc07 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sysctl implements reading of system parameters such as system limits

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