info

package
v0.0.0-...-457f07e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NKey   string
	Claims *jwt.UserClaims
)

Functions

func Get

func Get(conn *nats.EncodedConn, nkey string, req Request, resp *Response, timeout time.Duration) error

func GetWithContext

func GetWithContext(ctx context.Context, conn *nats.EncodedConn, nkey string, req Request, resp *Response) error

func Init

func Init(ctx context.Context) (err error)

Types

type Disk

type Disk struct {
	Partitions []disk.PartitionStat `json:"partitions,omitempty"`
}

type Load

type Load struct {
	Avg  *load.AvgStat  `json:"avg,omitempty"`
	Misc *load.MiscStat `json:"misc,omitempty"`
}

type Memory

type Memory struct {
	Virtual     *mem.VirtualMemoryStat `json:"virtual,omitempty"`
	Swap        *mem.SwapMemoryStat    `json:"swap,omitempty"`
	SwapDevices []*mem.SwapDevice      `json:"swapDevices,omitempty"`
}

type Nix

type Nix struct {
	Info   *nix.Info         `json:"info"`
	Config map[string]string `json:"nix-config"`
}

type NixOS

type NixOS struct {
	Version       string `json:"version"`
	CurrentSystem string `json:"current-system"`
}

type Request

type Request struct {
	All    bool `json:"all"`
	Host   bool `json:"host"`
	Nix    bool `json:"nix"`
	NixOS  bool `json:"nixos"`
	Cpus   bool `json:"cpus"`
	Load   bool `json:"load"`
	Memory bool `json:"memory"`
	Disk   bool `json:"disk"`
}

type Response

type Response struct {
	NKey    string         `json:"nkey"`
	Name    string         `json:"name"`
	Subject string         `json:"subject"`
	Host    *host.InfoStat `json:"host,omitempty"`
	Nix     *Nix           `json:"nix,omitempty"`
	NixOS   *NixOS         `json:"nixos,omitempty"`
	Cpus    []cpu.InfoStat `json:"cpus,omitempty"`
	Load    *Load          `json:"load,omitempty"`
	Memory  *Memory        `json:"memory,omitempty"`
	Disk    *Disk          `json:"disk,omitempty"`

	LastSeen time.Time
}

Jump to

Keyboard shortcuts

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