Documentation ¶
Index ¶
Constants ¶
const ( // LoadScale factor scales the output from sysinfo to the correct float // value. LoadScale = 65536 // XXX: is this correct or should it be 65535? )
const (
// ModuleName is the prefix given to all the functions in this module.
ModuleName = "sys"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultEnv ¶
DefaultEnv gets environment variable by name or returns default if non existing.
Types ¶
type CPUCountFact ¶
type CPUCountFact struct {
// contains filtered or unexported fields
}
CPUCountFact is a fact that returns the current CPU count.
func (*CPUCountFact) Close ¶
func (obj *CPUCountFact) Close() error
Close runs cleanup code for the fact and turns off the Stream.
func (*CPUCountFact) Info ¶
func (obj *CPUCountFact) Info() *facts.Info
Info returns static typing info about what the fact returns.
func (*CPUCountFact) Init ¶
func (obj *CPUCountFact) Init(init *facts.Init) error
Init runs startup code for this fact. Initializes the closeChan and sets the facts.Init variable.
func (CPUCountFact) Stream ¶
func (obj CPUCountFact) Stream() error
Stream returns the changing values that this fact has over time. It will first poll sysfs to get the initial cpu count, and then receives UEvents from the kernel as CPUs are added/removed.
type HostnameFact ¶
type HostnameFact struct {
// contains filtered or unexported fields
}
HostnameFact is a function that returns the hostname. TODO: support hostnames that change in the future.
func (*HostnameFact) Close ¶
func (obj *HostnameFact) Close() error
Close runs some shutdown code for this fact and turns off the stream.
func (*HostnameFact) Info ¶
func (obj *HostnameFact) Info() *facts.Info
Info returns some static info about itself.
func (*HostnameFact) Init ¶
func (obj *HostnameFact) Init(init *facts.Init) error
Init runs some startup code for this fact.
func (*HostnameFact) Stream ¶
func (obj *HostnameFact) Stream() error
Stream returns the single value that this fact has, and then closes.
type LoadFact ¶
type LoadFact struct {
// contains filtered or unexported fields
}
LoadFact is a fact which returns the current system load.
type UptimeFact ¶
type UptimeFact struct {
// contains filtered or unexported fields
}
UptimeFact is a fact which returns the current uptime of your system.
func (*UptimeFact) Close ¶
func (obj *UptimeFact) Close() error
Close runs some shutdown code for this fact and turns off the stream.
func (*UptimeFact) Info ¶
func (obj *UptimeFact) Info() *facts.Info
Info returns some static info about itself.
func (*UptimeFact) Init ¶
func (obj *UptimeFact) Init(init *facts.Init) error
Init runs some startup code for this fact.
func (*UptimeFact) Stream ¶
func (obj *UptimeFact) Stream() error
Stream returns the changing values that this fact has over time.