mockserver

package
v1.1.0-beta.0...-dd8df1a Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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.

func (*MockServer) Name

func (*MockServer) Name() string

Name returns the name of the server.

Jump to

Keyboard shortcuts

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