factory

package
v0.0.0-...-be15534 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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 NewClientFlags

func NewClientFlags() *ClientFlags

NewClientFlags creates new client flags.

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.

Directories

Path Synopsis
Package mock_factory is a generated GoMock package.
Package mock_factory is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL