Back to godoc.org
bosun.org / host

Package host

v0.0.0-...-8a7cd2d
Latest Go to latest

The latest major version is .

Published: Jun 18, 2020 | License: MIT | Module: bosun.org

Overview

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

Index

func NewHostNameProcessor

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

NewHostNameProcessor constructs a new name.Processor for host names

type Host

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

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

NewHost constructs a new Host object

type Manager

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

func NewManager(preserveFullHostName bool) (Manager, error)

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

func NewManagerForHostname

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 Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier