mockserver

package
v3.3.16+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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

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