mock

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Messenger

type Messenger struct {
	mock.Mock
	// contains filtered or unexported fields
}

Messenger is a messenger that returns error on every operation.

func NewMessenger

func NewMessenger() *Messenger

NewMessenger returns a mocked messenger used for testing.

func (*Messenger) Install

func (m *Messenger) Install(handler messenger.MessageHandler, msg proto.Message) error

Install is a mocked implementation.

func (*Messenger) Recv

func (m *Messenger) Recv(from *upid.UPID, msg proto.Message)

Recv receives a upid and a message, it will dispatch the message to its handler with the upid. This is for testing.

func (*Messenger) Route

func (m *Messenger) Route(ctx context.Context, upid *upid.UPID, msg proto.Message) error

func (*Messenger) Send

func (m *Messenger) Send(ctx context.Context, upid *upid.UPID, msg proto.Message) error

Send is a mocked implementation.

func (*Messenger) Start

func (m *Messenger) Start() error

Start is a mocked implementation.

func (*Messenger) Stop

func (m *Messenger) Stop() error

Stop is a mocked implementation.

func (*Messenger) UPID

func (m *Messenger) UPID() upid.UPID

UPID is a mocked implementation.

Jump to

Keyboard shortcuts

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