factory

package
v0.0.0-...-a345a4b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFlags

type ClientFlags struct {
	// 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) 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) 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.

func (*ClientFlags) Validate

func (c *ClientFlags) Validate() error

Validate makes sure provided values for ClientFlags are valid.

type ClientGetter

type ClientGetter interface {
	ToTLSConfig() (*tls.Config, error)
	ToGRPCDialOption() (grpc.DialOption, error)
	GetPdAddr() string
	GetLogLevel() string
	GetCredential() *security.Credential
}

ClientGetter defines the client getter.

type Factory

type Factory interface {
	ClientGetter
	EtcdClient() (*etcd.CDCEtcdClient, error)
	PdClient() (pd.Client, error)
}

Factory defines the client-side construction factory.

func NewFactory

func NewFactory(clientGetter ClientGetter) Factory

NewFactory creates a client build factory.

Jump to

Keyboard shortcuts

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