Documentation ¶
Index ¶
- Variables
- func InitCluster(ctx context.Context, cli pd.Client, httpCli pdHttp.Client) error
- type Case
- type Config
- type Coordinator
- func (c *Coordinator) GetAllEtcdCases() map[string]*Config
- func (c *Coordinator) GetAllGRPCCases() map[string]*Config
- func (c *Coordinator) GetAllHTTPCases() map[string]*Config
- func (c *Coordinator) GetEtcdCase(name string) (*Config, error)
- func (c *Coordinator) GetGRPCCase(name string) (*Config, error)
- func (c *Coordinator) GetHTTPCase(name string) (*Config, error)
- func (c *Coordinator) SetEtcdCase(name string, cfg *Config) error
- func (c *Coordinator) SetGRPCCase(name string, cfg *Config) error
- func (c *Coordinator) SetHTTPCase(name string, cfg *Config) error
- type EtcdCase
- type EtcdCreateFn
- type GRPCCase
- type GRPCCreateFn
- type HTTPCase
- type HTTPCreateFn
Constants ¶
This section is empty.
Variables ¶
var ( // Debug is the flag to print the output of api response for debug. Debug bool )
var EtcdCaseFnMap = map[string]EtcdCreateFn{
"Get": newGetKV(),
"Put": newPutKV(),
"Delete": newDeleteKV(),
"Txn": newTxnKV(),
}
EtcdCaseFnMap is the map for all etcd case creation function.
var GRPCCaseFnMap = map[string]GRPCCreateFn{
"GetRegion": newGetRegion(),
"GetRegionEnableFollower": newGetRegionEnableFollower(),
"GetStore": newGetStore(),
"GetStores": newGetStores(),
"ScanRegions": newScanRegions(),
"Tso": newTso(),
"UpdateGCSafePoint": newUpdateGCSafePoint(),
"UpdateServiceGCSafePoint": newUpdateServiceGCSafePoint(),
}
GRPCCaseFnMap is the map for all gRPC case creation function.
var HTTPCaseFnMap = map[string]HTTPCreateFn{
"GetRegionStatus": newRegionStats(),
"GetMinResolvedTS": newMinResolvedTS(),
}
HTTPCaseFnMap is the map for all HTTP case creation function.
Functions ¶
Types ¶
type Case ¶
type Case interface {
// contains filtered or unexported methods
}
Case is the interface for all cases.
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator managers the operation of the gRPC and HTTP case.
func NewCoordinator ¶
func NewCoordinator(ctx context.Context, httpClients []pdHttp.Client, gRPCClients []pd.Client, etcdClients []*clientv3.Client) *Coordinator
NewCoordinator returns a new coordinator.
func (*Coordinator) GetAllEtcdCases ¶
func (c *Coordinator) GetAllEtcdCases() map[string]*Config
GetAllEtcdCases returns the all etcd case configs.
func (*Coordinator) GetAllGRPCCases ¶
func (c *Coordinator) GetAllGRPCCases() map[string]*Config
GetAllGRPCCases returns the all gRPC case configs.
func (*Coordinator) GetAllHTTPCases ¶
func (c *Coordinator) GetAllHTTPCases() map[string]*Config
GetAllHTTPCases returns the all HTTP case configs.
func (*Coordinator) GetEtcdCase ¶
func (c *Coordinator) GetEtcdCase(name string) (*Config, error)
GetEtcdCase returns the etcd case config.
func (*Coordinator) GetGRPCCase ¶
func (c *Coordinator) GetGRPCCase(name string) (*Config, error)
GetGRPCCase returns the gRPC case config.
func (*Coordinator) GetHTTPCase ¶
func (c *Coordinator) GetHTTPCase(name string) (*Config, error)
GetHTTPCase returns the HTTP case config.
func (*Coordinator) SetEtcdCase ¶
func (c *Coordinator) SetEtcdCase(name string, cfg *Config) error
SetEtcdCase sets the config for the specific case.
func (*Coordinator) SetGRPCCase ¶
func (c *Coordinator) SetGRPCCase(name string, cfg *Config) error
SetGRPCCase sets the config for the specific case.
func (*Coordinator) SetHTTPCase ¶
func (c *Coordinator) SetHTTPCase(name string, cfg *Config) error
SetHTTPCase sets the config for the specific case.
type EtcdCase ¶
type EtcdCase interface { Case // contains filtered or unexported methods }
EtcdCase is the interface for all etcd api cases.
type EtcdCreateFn ¶
type EtcdCreateFn func() EtcdCase
EtcdCreateFn is function type to create EtcdCase.
type GRPCCase ¶
type GRPCCase interface { Case // contains filtered or unexported methods }
GRPCCase is the interface for all gRPC cases.
type GRPCCreateFn ¶
type GRPCCreateFn func() GRPCCase
GRPCCreateFn is function type to create GRPCCase.
type HTTPCase ¶
type HTTPCase interface { Case // contains filtered or unexported methods }
HTTPCase is the interface for all HTTP cases.
type HTTPCreateFn ¶
type HTTPCreateFn func() HTTPCase
HTTPCreateFn is function type to create HTTPCase.