host

package
v0.0.0-...-f3e8d88 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStatusInformation

func GetStatusInformation() *host.InfoStat

GetStatusInformation just returns an InfoStat object, we need some additional information that's not

Types

type Meta

type Meta struct {
	SocketHostname string   `json:"socket-hostname"`
	Timezones      []string `json:"timezones"`
	SocketFqdn     string   `json:"socket-fqdn"`
	EC2Hostname    string   `json:"ec2-hostname"`
	Hostname       string   `json:"hostname"`
	HostAliases    []string `json:"host_aliases"`
}

Meta is the metadata nested under the meta key

func GetMeta

func GetMeta() *Meta

GetMeta grabs the metadata from the cache and returns it, if the cache is empty, then it queries the information directly

type Payload

type Payload struct {
	Os            string       `json:"os"`
	PythonVersion string       `json:"python"`
	SystemStats   *systemStats `json:"systemStats"`
	Meta          *Meta        `json:"meta"`
	HostTags      *tags        `json:"host-tags"`
}

Payload handles the JSON unmarshalling of the metadata payload

func GetPayload

func GetPayload(hostname string) *Payload

GetPayload builds a metadata payload every time is called. Some data is collected only once, some is cached, some is collected at every call.

func GetPayloadFromCache

func GetPayloadFromCache(hostname string) *Payload

GetPayloadFromCache returns the payload from the cache if it exists, otherwise it creates it. The metadata reporting should always grab it fresh. Any other uses, e.g. status, should use this

Jump to

Keyboard shortcuts

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