Documentation
¶
Overview ¶
Package server describes a remote hive server: the ssh target a client reaches its daemon through.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidState = fmt.Errorf("not a valid State, try [%s]", strings.Join(_StateNames, ", "))
Functions ¶
func StateNames ¶
func StateNames() []string
StateNames returns a list of possible string values of State.
Types ¶
type Host ¶
type Host struct {
// Name is an ssh host or config alias, optionally with user@.
Name string
// ConfigFile is passed to ssh as -F when set.
ConfigFile string
// Binary is the hive path on the remote host. Empty means "hive".
Binary string
// Tmux is the tmux path on the remote host. Empty means "tmux", found on the
// PATH of a non-interactive ssh command, which often lacks a package
// manager's directory.
Tmux string
}
type State ¶
type State string
State is how a client last found a server. Connecting means no check has answered yet. Incompatible means the daemon answered with a version this client cannot use.
ENUM(connecting, connected, offline, incompatible)
const ( // StateConnecting is a State of type connecting. StateConnecting State = "connecting" // StateConnected is a State of type connected. StateConnected State = "connected" // StateOffline is a State of type offline. StateOffline State = "offline" // StateIncompatible is a State of type incompatible. StateIncompatible State = "incompatible" )
func ParseState ¶
ParseState attempts to convert a string to a State.
func (*State) AppendText ¶
AppendText appends the textual representation of itself to the end of b (allocating a larger slice if necessary) and returns the updated slice.
Implementations must not retain b, nor mutate any bytes within b[:len(b)].
func (State) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (State) MarshalText ¶
MarshalText implements the text marshaller method.
func (*State) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.