mocks

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Anything is used where the expectation should not be considered.
	Anything = "mocks.Anything"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildMessage

type ChildMessage struct {
	Index int
	Msg   streams.Message
}

ChildMessage represents a message forwarded to a child index.

type Pipe

type Pipe struct {
	// contains filtered or unexported fields
}

Pipe is a mock Pipe.

func NewPipe

func NewPipe(t *testing.T) *Pipe

NewPipe create a new mock Pipe instance.

func (*Pipe) AssertExpectations

func (p *Pipe) AssertExpectations()

AssertExpectations asserts that the expectations were met.

func (*Pipe) Commit

func (p *Pipe) Commit(msg streams.Message) error

Commit commits the current state in the sources.

func (*Pipe) ExpectCommit

func (p *Pipe) ExpectCommit()

ExpectCommit registers an expectation of a Commit on the Pipe.

func (*Pipe) ExpectForward

func (p *Pipe) ExpectForward(k, v interface{})

ExpectForward registers an expectation of a Forward on the Pipe.

func (*Pipe) ExpectForwardToChild

func (p *Pipe) ExpectForwardToChild(k, v interface{}, index int)

ExpectForwardToChild registers an expectation of a ForwardToChild on the Pipe.

func (*Pipe) ExpectMark

func (p *Pipe) ExpectMark(k, v interface{})

ExpectMark registers an expectation of a Mark on the Pipe.

func (*Pipe) Forward

func (p *Pipe) Forward(msg streams.Message) error

Forward queues the data to all processor children in the topology.

func (*Pipe) ForwardToChild

func (p *Pipe) ForwardToChild(msg streams.Message, index int) error

ForwardToChild queues the data to the the given processor(s) child in the topology.

func (*Pipe) Mark

func (p *Pipe) Mark(msg streams.Message) error

Mark indicates that the message has been delt with

func (*Pipe) Messages

func (p *Pipe) Messages() []ChildMessage

Messages gets the queued Messages for each Node.

func (*Pipe) ShouldError

func (p *Pipe) ShouldError()

ShouldError indicates that an error should be returned on the next operation.

Jump to

Keyboard shortcuts

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