Documentation
¶
Overview ¶
Package cli implements the gotwamp command (SPEC §10): a thin gRPC client of gotwampd over its Unix domain socket, or over TCP with mutual TLS (--server, ADR 0010).
Index ¶
Constants ¶
View Source
const ( ExitOK = 0 ExitFailure = 1 // all packets lost, or a general error ExitUsage = 2 // bad arguments or configuration ExitProtocol = 4 // protocol or control error ExitInterrupted = 130 // SIGINT )
Exit statuses (SPEC §10.4).
View Source
const DefaultSocket = "/run/gotwamp/gotwampd.sock"
DefaultSocket is the gotwampd API socket used without --socket or GOTWAMP_SOCKET.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Stdout, Stderr io.Writer
// Getenv reads the environment; nil means os.Getenv.
Getenv func(string) string
// Dial connects to gotwampd at socket; nil dials the Unix socket.
Dial func(socket string) (*grpc.ClientConn, error)
// Interrupt delivers SIGINT and SIGTERM. The first one stops a running
// ping gracefully (its summary is shown) and cancels other commands;
// the second cancels everything. Nil means no signals.
Interrupt <-chan struct{}
}
Env is the outside world of the command.
Click to show internal directories.
Click to hide internal directories.