mockserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 9 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 {
	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