host

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {

	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact `json:"redactions"`
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

func NewDisk

func NewDisk(cfg DiskConfig) *Disk

func NewDiskWithContext added in v0.5.0

func NewDiskWithContext(ctx context.Context, cfg DiskConfig) *Disk

func (Disk) ID

func (d Disk) ID() string

func (Disk) Run

func (d Disk) Run() op.Op

type DiskConfig added in v0.5.0

type DiskConfig struct {
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout time.Duration
}

type EtcHosts

type EtcHosts struct {
	OS         string           `json:"os"`
	Redactions []*redact.Redact `json:"redactions"`
	Timeout    runner.Timeout   `json:"timeout"`
	// contains filtered or unexported fields
}

func NewEtcHosts

func NewEtcHosts(cfg EtcHostsConfig) *EtcHosts

func NewEtcHostsWithContext added in v0.5.0

func NewEtcHostsWithContext(ctx context.Context, cfg EtcHostsConfig) *EtcHosts

func (EtcHosts) ID

func (r EtcHosts) ID() string

func (EtcHosts) Run

func (r EtcHosts) Run() op.Op

type EtcHostsConfig added in v0.5.0

type EtcHostsConfig struct {
	OS         string
	Redactions []*redact.Redact
	Timeout    runner.Timeout
}

type FSTab

type FSTab struct {
	OS      string         `json:"os"`
	Shell   runner.Runner  `json:"shell"`
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

FSTab accepts

func NewFSTab

func NewFSTab(cfg FSTabConfig) (*FSTab, error)

NewFSTab takes FSTabConfig and returns a runnable FSTab.

func NewFSTabWithContext added in v0.5.0

func NewFSTabWithContext(ctx context.Context, cfg FSTabConfig) (*FSTab, error)

NewFSTabWithContext takes a Context and FSTabConfig and returns a runnable FSTab.

func (FSTab) ID

func (r FSTab) ID() string

ID returns the runner ID for FSTab.

func (FSTab) Run

func (r FSTab) Run() op.Op

Run executes the FSTab Runner and returns an op.Op result.

type FSTabConfig added in v0.5.0

type FSTabConfig struct {
	OS         string           `json:"os"`
	Timeout    runner.Timeout   `json:"timeout"`
	Redactions []*redact.Redact `json:"redactions"`
}

FSTabConfig takes each parameter to configure an FSTab runner implementation.

type Get

type Get struct {
	Path string `json:"path"`
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact `json:"redactions"`
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

func NewGet added in v0.5.0

func NewGet(cfg GetConfig) (*Get, error)

func NewGetWithContext added in v0.5.0

func NewGetWithContext(ctx context.Context, cfg GetConfig) (*Get, error)

func (Get) ID

func (g Get) ID() string

func (Get) Run

func (g Get) Run() op.Op

type GetConfig added in v0.5.0

type GetConfig struct {
	Path string
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout time.Duration
}

type IPTables

type IPTables struct {
	OS         string           `json:"os"`
	Commands   []string         `json:"commands"`
	Redactions []*redact.Redact `json:"redactions"`
	Timeout    runner.Timeout   `json:"timeout"`
	// contains filtered or unexported fields
}

func NewIPTables

func NewIPTables(cfg IPTablesConfig) *IPTables

NewIPTables returns a runner configured to run several iptables commands

func NewIPTablesWithContext added in v0.5.0

func NewIPTablesWithContext(ctx context.Context, cfg IPTablesConfig) *IPTables

NewIPTablesWithContext returns a runner configured to run several iptables commands

func (IPTables) ID

func (r IPTables) ID() string

func (IPTables) Run

func (r IPTables) Run() op.Op

type IPTablesConfig added in v0.5.0

type IPTablesConfig struct {
	OS         string
	Redactions []*redact.Redact
	Timeout    runner.Timeout
}

type Info

type Info struct {

	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact `json:"redactions"`
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

func NewInfo

func NewInfo(cfg InfoConfig) *Info

func NewInfoWithContext added in v0.5.0

func NewInfoWithContext(ctx context.Context, cfg InfoConfig) *Info

func (Info) ID

func (i Info) ID() string

func (Info) Run

func (i Info) Run() op.Op

type InfoConfig added in v0.5.0

type InfoConfig struct {
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout time.Duration
}

type InfoStat

type InfoStat struct {
	Hostname             string `json:"hostname"`
	OS                   string `json:"os"`
	Platform             string `json:"platform"`
	PlatformFamily       string `json:"platformFamily"`
	PlatformVersion      string `json:"platformVersion"`
	KernelVersion        string `json:"kernelVersion"`
	KernelArch           string `json:"kernelArch"`
	VirtualizationSystem string `json:"virtualizationSystem"`
	VirtualizationRole   string `json:"virtualizationRole"`
	HostID               string `json:"hostId"`

	Uptime   uint64 `json:"uptime"`
	BootTime uint64 `json:"bootTime"`
	Procs    uint64 `json:"procs"`
}

InfoStat includes general information about the Host. It serves as the basis for the results produced by the Info runner.

type Memory

type Memory struct {
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

func NewMemory added in v0.5.0

func NewMemory(timeout runner.Timeout) *Memory

func NewMemoryWithContext added in v0.5.0

func NewMemoryWithContext(ctx context.Context, timeout runner.Timeout) *Memory

func (Memory) ID

func (m Memory) ID() string

func (Memory) Run

func (m Memory) Run() op.Op

Run calls out to mem.VirtualMemory

type Network

type Network struct {

	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact `json:"redactions"`
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

func NewNetwork

func NewNetwork(cfg NetworkConfig) *Network

func NewNetworkWithContext added in v0.5.0

func NewNetworkWithContext(ctx context.Context, cfg NetworkConfig) *Network

func (Network) ID

func (n Network) ID() string

func (Network) Run

func (n Network) Run() op.Op

type NetworkConfig added in v0.5.0

type NetworkConfig struct {
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout time.Duration
}

type NetworkInterface

type NetworkInterface struct {
	Index int      `json:"index"`
	MTU   int      `json:"mtu"`
	Name  string   `json:"name"`
	Flags []string `json:"flags"`
	Addrs []string `json:"addrs"`
}

NetworkInterface represents details about a network interface. This serves as the basis for the results produced by the Network runner.

type OS

type OS struct {

	// OS is the operating system family of the host.
	OS string `json:"os"`
	// Command is the command that will execute to gather OS details.
	Command string `json:"command"`
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact `json:"redactions"`
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

func NewOS

func NewOS(cfg OSConfig) *OS

func NewOSWithContext added in v0.5.0

func NewOSWithContext(ctx context.Context, cfg OSConfig) *OS

func (OS) ID

func (o OS) ID() string

func (OS) Run

func (o OS) Run() op.Op

Run calls the given OS utility to get information on the operating system

type OSConfig added in v0.5.0

type OSConfig struct {
	// OS is the operating system family of the host.
	OS string
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout time.Duration
}

type Partition

type Partition struct {
	Device     string   `json:"device"`
	Mountpoint string   `json:"mountpoint"`
	Fstype     string   `json:"fstype"`
	Opts       []string `json:"opts"`
}

Partition includes details about a disk partition. This serves as the basis for the results produced by the Disk runner.

type Proc

type Proc struct {
	Name string `json:"name"`
	PID  int    `json:"pid"`
	PPID int    `json:"ppid"`
}

Proc represents the process data we're collecting and returning

type ProcFile

type ProcFile struct {
	OS         string           `json:"os"`
	Commands   []string         `json:"commands"`
	Redactions []*redact.Redact `json:"redactions"`
	Timeout    runner.Timeout   `json:"timeout"`
	// contains filtered or unexported fields
}

func NewProcFile

func NewProcFile(cfg ProcFileConfig) *ProcFile

func NewProcFileWithContext added in v0.5.0

func NewProcFileWithContext(ctx context.Context, cfg ProcFileConfig) *ProcFile

func (ProcFile) ID

func (p ProcFile) ID() string

func (ProcFile) Run

func (p ProcFile) Run() op.Op

type ProcFileConfig added in v0.5.0

type ProcFileConfig struct {
	OS         string
	Redactions []*redact.Redact
	Timeout    runner.Timeout
}

type Process

type Process struct {

	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact `json:"redactions"`
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout runner.Timeout `json:"timeout"`
	// contains filtered or unexported fields
}

Process represents a single OS Process

func NewProcess

func NewProcess(cfg ProcessConfig) *Process

func NewProcessWithContext added in v0.5.0

func NewProcessWithContext(ctx context.Context, cfg ProcessConfig) *Process

func (Process) ID

func (p Process) ID() string

func (Process) Run

func (p Process) Run() op.Op

type ProcessConfig added in v0.5.0

type ProcessConfig struct {
	// Redactions includes any redactions to apply to the output of the runner.
	Redactions []*redact.Redact
	// Timeout specifies the amount of time that the runner should be allowed to execute before cancellation.
	Timeout time.Duration
}

Jump to

Keyboard shortcuts

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