Documentation
¶
Overview ¶
Package cli is keyforge's command line: Cobra commands over the HTTP control plane.
The commands are a client of the control plane and hold no logic of their own, so there is one implementation of each operation and the command line cannot do what the service would refuse. Two transports are offered:
- A remote server, named by --server or KEYFORGE_SERVER, with a bearer token from --token-file or KEYFORGE_TOKEN. This is the standalone `keyforge` binary.
- An in-process handler, for a host that embeds the commands in its own binary and has the control plane in the same process. No network is involved, and the host's own authorizer and actor naming apply.
A few commands need no server: generating a root key, and reading the header of a keyring file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootCommand ¶
NewRootCommand returns the `keyforge` command with every subcommand attached.
Types ¶
type Options ¶
type Options struct {
// Handler, when set, is the control plane in this process; --server is then
// not needed and no network is used.
Handler http.Handler
// Out and Err default to the standard streams.
Out, Err io.Writer
// HTTPClient is used for a remote server. The default has a timeout.
HTTPClient *http.Client
// Env reads an environment variable; the default is os.Getenv.
Env func(string) string
}
Options configures the command tree.
Click to show internal directories.
Click to hide internal directories.