Documentation ¶
Index ¶
- type MockServer
- func (*MockServer) ClusterID() uint64
- func (s *MockServer) GetBasicCluster() *core.BasicCluster
- func (s *MockServer) GetLeader() *pdpb.Member
- func (s *MockServer) GetMemberInfo() *pdpb.Member
- func (s *MockServer) GetRegions() []*core.RegionInfo
- func (s *MockServer) GetStorage() storage.Storage
- func (*MockServer) GetTLSConfig() *grpcutil.TLSConfig
- func (s *MockServer) LoopContext() context.Context
- func (*MockServer) Name() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockServer ¶
type MockServer struct {
// contains filtered or unexported fields
}
MockServer is used to mock Server for test use.
func NewMockServer ¶
func NewMockServer(ctx context.Context, member, leader *pdpb.Member, storage storage.Storage, bc *core.BasicCluster) *MockServer
NewMockServer creates a new MockServer.
func (*MockServer) ClusterID ¶
func (*MockServer) ClusterID() uint64
ClusterID returns the cluster ID of the server.
func (*MockServer) GetBasicCluster ¶
func (s *MockServer) GetBasicCluster() *core.BasicCluster
GetBasicCluster returns the basic cluster of the server.
func (*MockServer) GetLeader ¶
func (s *MockServer) GetLeader() *pdpb.Member
GetLeader returns the leader of the server.
func (*MockServer) GetMemberInfo ¶
func (s *MockServer) GetMemberInfo() *pdpb.Member
GetMemberInfo returns the member info of the server.
func (*MockServer) GetRegions ¶
func (s *MockServer) GetRegions() []*core.RegionInfo
GetRegions returns the regions of the server.
func (*MockServer) GetStorage ¶
func (s *MockServer) GetStorage() storage.Storage
GetStorage returns the storage of the server.
func (*MockServer) GetTLSConfig ¶
func (*MockServer) GetTLSConfig() *grpcutil.TLSConfig
GetTLSConfig returns the TLS config of the server.
func (*MockServer) LoopContext ¶
func (s *MockServer) LoopContext() context.Context
LoopContext returns the context of the server.
Click to show internal directories.
Click to hide internal directories.