Documentation ¶
Index ¶
- type ClientAuth
- type ClientFlags
- func (c *ClientFlags) AddFlags(cmd *cobra.Command)
- func (c *ClientFlags) CompleteClientAuthParameters(cmd *cobra.Command) error
- func (c *ClientFlags) GetAuthParameters() url.Values
- func (c *ClientFlags) GetCredential() *security.Credential
- func (c *ClientFlags) GetLogLevel() string
- func (c *ClientFlags) GetPdAddr() string
- func (c *ClientFlags) GetServerAddr() string
- func (c *ClientFlags) ToGRPCDialOption() (grpc.DialOption, error)
- func (c *ClientFlags) ToTLSConfig() (*tls.Config, error)
- type ClientGetter
- type Factory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientAuth ¶
type ClientAuth struct { // User Credential User string `toml:"ticdc_user,omitempty"` Password string `toml:"ticdc_password,omitempty"` // TLS Client Certificate CaPath string `toml:"ca_path,omitempty"` CertPath string `toml:"cert_path,omitempty"` KeyPath string `toml:"key_path,omitempty"` }
ClientAuth specifies the authentication parameters.
func ReadFromDefaultPath ¶
func ReadFromDefaultPath() (*ClientAuth, error)
ReadFromDefaultPath reads the client authentication from default path.
func (*ClientAuth) StoreToDefaultPath ¶
func (c *ClientAuth) StoreToDefaultPath() error
StoreToDefaultPath stores the client authentication to default path.
type ClientFlags ¶
type ClientFlags struct { ClientAuth // contains filtered or unexported fields }
ClientFlags specifies the parameters needed to construct the client.
func (*ClientFlags) AddFlags ¶
func (c *ClientFlags) AddFlags(cmd *cobra.Command)
AddFlags receives a *cobra.Command reference and binds flags related to template printing to it.
func (*ClientFlags) CompleteClientAuthParameters ¶
func (c *ClientFlags) CompleteClientAuthParameters(cmd *cobra.Command) error
CompleteClientAuthParameters completes the authentication parameters.
func (*ClientFlags) GetAuthParameters ¶
func (c *ClientFlags) GetAuthParameters() url.Values
GetAuthParameters returns the authentication parameters.
func (*ClientFlags) GetCredential ¶
func (c *ClientFlags) GetCredential() *security.Credential
GetCredential returns credential.
func (*ClientFlags) GetLogLevel ¶
func (c *ClientFlags) GetLogLevel() string
GetLogLevel returns log level.
func (*ClientFlags) GetPdAddr ¶
func (c *ClientFlags) GetPdAddr() string
GetPdAddr returns pd address.
func (*ClientFlags) GetServerAddr ¶
func (c *ClientFlags) GetServerAddr() string
GetServerAddr returns cdc cluster id.
func (*ClientFlags) ToGRPCDialOption ¶
func (c *ClientFlags) ToGRPCDialOption() (grpc.DialOption, error)
ToGRPCDialOption returns the option of GRPC dial.
func (*ClientFlags) ToTLSConfig ¶
func (c *ClientFlags) ToTLSConfig() (*tls.Config, error)
ToTLSConfig returns the configuration of tls.
type ClientGetter ¶
type ClientGetter interface { ToTLSConfig() (*tls.Config, error) ToGRPCDialOption() (grpc.DialOption, error) GetPdAddr() string GetServerAddr() string GetLogLevel() string GetCredential() *security.Credential GetAuthParameters() url.Values }
ClientGetter defines the client getter.
type Factory ¶
type Factory interface { ClientGetter EtcdClient() (*etcd.CDCEtcdClientImpl, error) PdClient() (pd.Client, error) APIV2Client() (apiv2client.APIV2Interface, error) }
Factory defines the client-side construction factory.
func NewFactory ¶
func NewFactory(clientGetter ClientGetter) Factory
NewFactory creates a client build factory.