host

package
v0.0.0-...-e25bc3e Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHostNameProcessor

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

NewHostNameProcessor constructs a new name.Processor for host names

Types

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

Jump to

Keyboard shortcuts

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