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) 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 Config
- type InitializeOpt
- type ServerInfo
- type TLSConfig
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) Client ¶
Client returns the APIClient
func (*AgentCli) ClientInfo ¶
func (cli *AgentCli) ClientInfo() ClientInfo
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) 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 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 ¶
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
type Config ¶
type Config struct { LigatoAPIVersion string `json:"ligato-api-version"` Host string `json:"host"` ServiceLabel string `json:"service-label"` GRPCPort int `json:"grpc-port"` HTTPPort int `json:"http-port"` HTTPBasicAuth string `json:"http-basic-auth"` EtcdEndpoints []string `json:"etcd-endpoints"` EtcdDialTimeout time.Duration `json:"etcd-dial-timeout"` InsecureTLS bool `json:"insecure-tls"` GRPCSecure *TLSConfig `json:"grpc-tls"` HTTPSecure *TLSConfig `json:"http-tls"` KVDBSecure *TLSConfig `json:"kvdb-tls"` }
Config represents configuration for AgentCTL.
func MakeConfig ¶
MakeConfig returns new Config with values from Viper.
func (*Config) DebugOutput ¶
DebugOutput returns Config as string to be used for debug output.
func (*Config) ShouldUseSecureGRPC ¶
ShouldUseSecureGRPC returns whether or not to use TLS for GRPC connection.
func (*Config) ShouldUseSecureHTTP ¶
ShouldUseSecureHTTP returns whether or not to use TLS for HTTP connection.
type InitializeOpt ¶
InitializeOpt is the type of the functional options passed to AgentCli.Initialize