Documentation ¶
Index ¶
- func SetLogLevel(logLevel string)
- func UserAgent() string
- type AgentCli
- func (cli *AgentCli) Apply(ops ...AgentCliOption) error
- func (cli *AgentCli) Client() client.APIClient
- func (cli *AgentCli) ClientInfo() ClientInfo
- func (cli *AgentCli) DefaultVersion() string
- func (cli *AgentCli) Err() io.Writer
- func (cli *AgentCli) In() *streams.In
- func (cli *AgentCli) Initialize(opts *ClientOptions, ops ...InitializeOpt) error
- func (cli *AgentCli) KVProtoBroker() (keyval.ProtoBroker, error)
- func (cli *AgentCli) Out() *streams.Out
- func (cli *AgentCli) ServerInfo() ServerInfo
- func (cli *AgentCli) SetIn(in *streams.In)
- type AgentCliOption
- func WithClient(c client.APIClient) AgentCliOption
- func WithCombinedStreams(combined io.Writer) AgentCliOption
- func WithErrorStream(err io.Writer) AgentCliOption
- func WithInputStream(in io.ReadCloser) AgentCliOption
- func WithOutputStream(out io.Writer) AgentCliOption
- func WithStandardStreams() AgentCliOption
- type Cli
- type ClientInfo
- type ClientOptions
- type InitializeOpt
- type ServerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentCli ¶
type AgentCli struct {
// contains filtered or unexported fields
}
func NewAgentCli ¶
func NewAgentCli(ops ...AgentCliOption) (*AgentCli, error)
NewAgentCli returns a AgentCli instance with all operators applied on it. It applies by default the standard streams.
func (*AgentCli) Apply ¶
func (cli *AgentCli) Apply(ops ...AgentCliOption) error
Apply all the operation on the cli
func (*AgentCli) ClientInfo ¶
func (cli *AgentCli) ClientInfo() ClientInfo
func (*AgentCli) DefaultVersion ¶
func (*AgentCli) Initialize ¶
func (cli *AgentCli) Initialize(opts *ClientOptions, ops ...InitializeOpt) error
Initialize the agentCli runs initialization that must happen after command line flags are parsed.
func (*AgentCli) KVProtoBroker ¶
func (cli *AgentCli) KVProtoBroker() (keyval.ProtoBroker, error)
func (*AgentCli) ServerInfo ¶
func (cli *AgentCli) ServerInfo() ServerInfo
type AgentCliOption ¶
AgentCliOption applies a modification on a AgentCli.
func WithCombinedStreams ¶
func WithCombinedStreams(combined io.Writer) AgentCliOption
WithCombinedStreams uses the same stream for the output and error streams.
func WithErrorStream ¶
func WithErrorStream(err io.Writer) AgentCliOption
WithErrorStream sets a cli error stream.
func WithInputStream ¶
func WithInputStream(in io.ReadCloser) AgentCliOption
WithInputStream sets a cli input stream.
func WithOutputStream ¶
func WithOutputStream(out io.Writer) AgentCliOption
WithOutputStream sets a cli output stream.
func WithStandardStreams ¶
func WithStandardStreams() AgentCliOption
WithStandardStreams sets a cli in, out and err streams with the standard streams.
type Cli ¶
type Cli interface { Client() client.APIClient KVProtoBroker() (keyval.ProtoBroker, error) Out() *streams.Out Err() io.Writer In() *streams.In SetIn(in *streams.In) Apply(ops ...AgentCliOption) error ServerInfo() ServerInfo ClientInfo() ClientInfo DefaultVersion() string }
Cli represents the agent command line client.
type ClientInfo ¶
type ClientInfo struct {
DefaultVersion string
}
ClientInfo stores details about the supported features of the client
type ClientOptions ¶
type ClientOptions struct { Debug bool LogLevel string AgentHost string PortGRPC int PortHTTP int ServiceLabel string Endpoints []string // TODO: support TLS TLS bool TLSVerify bool TLSOptions *tlsconfig.Options }
ClientOptions define options for the client.
func NewClientOptions ¶
func NewClientOptions() *ClientOptions
NewClientOptions returns a new ClientOptions
func (*ClientOptions) InstallFlags ¶
func (opts *ClientOptions) InstallFlags(flags *pflag.FlagSet)
InstallFlags adds flags for the common options on the FlagSet
func (*ClientOptions) SetDefaultOptions ¶
func (opts *ClientOptions) SetDefaultOptions(flags *pflag.FlagSet)
SetDefaultOptions sets default values for options after flag parsing is complete
type InitializeOpt ¶
InitializeOpt is the type of the functional options passed to AgentCli.Initialize
type ServerInfo ¶
type ServerInfo struct {
OSType string
}
ServerInfo stores details about the supported features and platform of the server