v3.3.27+incompatible Latest Latest

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 1



Package mockserver provides mock implementations for etcdserver's server interface.



This section is empty.


This section is empty.


This section is empty.


type MockServer

type MockServer struct {
	Network    string
	Address    string
	GrpcServer *grpc.Server
	// contains filtered or unexported fields

MockServer provides a mocked out grpc server of the etcdserver interface.

func (*MockServer) ResolverAddress

func (ms *MockServer) ResolverAddress() resolver.Address

type MockServers

type MockServers struct {
	Servers []*MockServer
	// contains filtered or unexported fields

MockServers provides a cluster of mocket out gprc servers of the etcdserver interface.

func StartMockServers

func StartMockServers(count int) (ms *MockServers, err error)

StartMockServers creates the desired count of mock servers and starts them.

func StartMockServersOnNetwork

func StartMockServersOnNetwork(count int, network string) (ms *MockServers, err error)

StartMockServersOnNetwork creates mock servers on either 'tcp' or 'unix' sockets.

func (*MockServers) StartAt

func (ms *MockServers) StartAt(idx int) (err error)

StartAt restarts mock server at given index.

func (*MockServers) Stop

func (ms *MockServers) Stop()

Stop stops the mock server, immediately closing all open connections and listeners.

func (*MockServers) StopAt

func (ms *MockServers) StopAt(idx int)

StopAt stops mock server at given index.

Jump to

Keyboard shortcuts

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