Back to godoc.org
github.com/coreos/etcd / pkg / mock / mockserver

Package mockserver

v3.3.22+incompatible
Latest Go to latest

The latest major version is .

Published: May 20, 2020 | License: Apache-2.0 | Module: github.com/coreos/etcd

Overview

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

Index

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier