bosun.org: bosun.org/host Index | Files

package host

import "bosun.org/host"

Package host contains functionality for dealing with the machine which Bosun is running on.

Index

Package Files

host.go manager.go name.go

func NewHostNameProcessor Uses

func NewHostNameProcessor(useFullName bool) (name.Processor, error)

NewHostNameProcessor constructs a new name.Processor for host names

type Host Uses

type Host interface {
    GetName() string
    SetName(name string) error
    GetNameProcessor() name.Processor
    SetNameProcessor(np name.Processor) error
}

Host is an interface which defines operations which can be performed against the machine which Bosun is running on.

GetName returns the name of the host.

SetName allows for the current host name to be overridden.

GetNameProcessor returns the name.Processor that is associated with the host.

SetNameProcessor allows for the name.Processor that is associated with the host to be overridden.

func NewHost Uses

func NewHost(name string, np name.Processor) (Host, error)

NewHost constructs a new Host object

type Manager Uses

type Manager interface {
    GetNameProcessor() name.Processor
    GetHost() Host
    GetHostName() string
}

Manager is an interface for types which manage hosts

GetNameProcessor returns a name.Processor which is suitable for hosts

GetHost returns the Host that represents the machine which the process is running on

GetHostName returns the name of the managed host - is simply more convenient than calling manager.GetHost().GetName()

func NewManager Uses

func NewManager(preserveFullHostName bool) (Manager, error)

NewManager constructs a new Manager for a host which is named by the operating system

func NewManagerForHostname Uses

func NewManagerForHostname(hostname string, preserveFullHostName bool) (Manager, error)

NewManagerForHostname constructs a new Manager for a host which is named according to the 'hostname' parameter

Package host imports 7 packages (graph) and is imported by 4 packages. Updated 2020-05-30. Refresh now. Tools for package owners.