Version: v0.4.1 Latest Latest

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

Go to latest
Published: Mar 14, 2016 License: MIT, MIT Imports: 10 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Mock

type Mock struct {
	// contains filtered or unexported fields

Mock is up a mock Hyperbahn server for tests.

func New

func New() (*Mock, error)

New returns a mock Hyperbahn server that can be used for testing.

func (*Mock) Close

func (h *Mock) Close()

Close stops the mock Hyperbahn server.

func (*Mock) Configuration

func (h *Mock) Configuration() hyperbahn.Configuration

Configuration returns a hyperbahn.Configuration object used to configure a hyperbahn.Client to talk to this mock server.

func (*Mock) Discover

func (h *Mock) Discover(ctx thrift.Context, query *hthrift.DiscoveryQuery) (*hthrift.DiscoveryResult_, error)

Discover returns the IPs for a discovery query if some were set using SetDiscoverResult. Otherwise, it returns an error.

func (*Mock) GetAdvertised

func (h *Mock) GetAdvertised() []string

GetAdvertised returns the list of services registered.

func (*Mock) QueueError

func (h *Mock) QueueError()

QueueError queues an error to be returned on the next advertise call.

func (*Mock) QueueResponse

func (h *Mock) QueueResponse(numConnections int)

QueueResponse queues a response from Hyperbahn. numConnections must be greater than 0.

func (*Mock) SetDiscoverResult

func (h *Mock) SetDiscoverResult(serviceName string, hostPorts []string)

SetDiscoverResult sets the given hostPorts as results for the Discover call.

Jump to

Keyboard shortcuts

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