mutator

package
v0.0.0-...-da8027b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mutator is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommandHandlerNotFound = errors.New("command handler not found")
	ErrEventHandlerNotFound   = errors.New("event handler not found")
	ErrNoChange               = errors.New("no change")
	ErrRetryIt                = errors.New("err retry it")
	ErrNoIdentifier           = errors.New("stream identifier not assigned")
)

Functions

This section is empty.

Types

type AfterCommandFunc

type AfterCommandFunc func(context.Context, stream.Command, *stream.Reply, stream.Stream) error

type BeforeCommandFunc

type BeforeCommandFunc func(context.Context, stream.Command) error

type BeforeEventFunc

type BeforeEventFunc func(context.Context, stream.Event) error

type CommandHandler

type CommandHandler interface {
	HandleCommand(context.Context, stream.Command, stream.Stream) (*stream.Reply, error)
}

type CommandHandlerFunc

type CommandHandlerFunc func(context.Context, stream.Command, stream.Stream) error

type CommandWithReplyHandlerFunc

type CommandWithReplyHandlerFunc func(context.Context, stream.Command, stream.Stream) (*stream.Reply, error)

type ContextFunc

type ContextFunc func(context.Context) context.Context

type Controller

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

func (*Controller) CommandHandler

func (c *Controller) CommandHandler(h CommandHandler)

func (*Controller) EventHandler

func (c *Controller) EventHandler(h EventHandler)

func (*Controller) HandleEvent

func (c *Controller) HandleEvent(ctx context.Context, e stream.Event) error

func (*Controller) MatchEvent

func (c *Controller) MatchEvent(ctx context.Context, et stream.EventType) bool

func (*Controller) Receive

func (c *Controller) Receive(ctx context.Context, cmd stream.Command) (r *stream.Reply, err error)

func (*Controller) Sink

func (c *Controller) Sink() *Sink

type ErrorFormatter

type ErrorFormatter func(context.Context, error) error

type ErrorHandlerFunc

type ErrorHandlerFunc func(context.Context, stream.Stream, error)

type EventHandler

type EventHandler interface {
	MatchEvent(context.Context, stream.EventType) bool
	BeforeHandleEvent(stream.Event) stream.ID
	HandleEvent(context.Context, stream.Event, stream.Stream) error
}

type EventHandlerFunc

type EventHandlerFunc func(context.Context, stream.Event, stream.Stream) error

type MockCommandHandler

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

MockCommandHandler is a mock of CommandHandler interface

func NewMockCommandHandler

func NewMockCommandHandler(ctrl *gomock.Controller) *MockCommandHandler

NewMockCommandHandler creates a new mock instance

func (*MockCommandHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockCommandHandler) HandleCommand

func (m *MockCommandHandler) HandleCommand(arg0 context.Context, arg1 stream.Command, arg2 stream.Stream) (*stream.Reply, error)

HandleCommand mocks base method

type MockCommandHandlerMockRecorder

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

MockCommandHandlerMockRecorder is the mock recorder for MockCommandHandler

func (*MockCommandHandlerMockRecorder) HandleCommand

func (mr *MockCommandHandlerMockRecorder) HandleCommand(arg0, arg1, arg2 interface{}) *gomock.Call

HandleCommand indicates an expected call of HandleCommand

type MockEventHandler

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

MockEventHandler is a mock of EventHandler interface

func NewMockEventHandler

func NewMockEventHandler(ctrl *gomock.Controller) *MockEventHandler

NewMockEventHandler creates a new mock instance

func (*MockEventHandler) BeforeHandleEvent

func (m *MockEventHandler) BeforeHandleEvent(arg0 stream.Event) stream.ID

BeforeHandleEvent mocks base method

func (*MockEventHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockEventHandler) HandleEvent

func (m *MockEventHandler) HandleEvent(arg0 context.Context, arg1 stream.Event, arg2 stream.Stream) error

HandleEvent mocks base method

func (*MockEventHandler) MatchEvent

func (m *MockEventHandler) MatchEvent(arg0 context.Context, arg1 stream.EventType) bool

MatchEvent mocks base method

type MockEventHandlerMockRecorder

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

MockEventHandlerMockRecorder is the mock recorder for MockEventHandler

func (*MockEventHandlerMockRecorder) BeforeHandleEvent

func (mr *MockEventHandlerMockRecorder) BeforeHandleEvent(arg0 interface{}) *gomock.Call

BeforeHandleEvent indicates an expected call of BeforeHandleEvent

func (*MockEventHandlerMockRecorder) HandleEvent

func (mr *MockEventHandlerMockRecorder) HandleEvent(arg0, arg1, arg2 interface{}) *gomock.Call

HandleEvent indicates an expected call of HandleEvent

func (*MockEventHandlerMockRecorder) MatchEvent

func (mr *MockEventHandlerMockRecorder) MatchEvent(arg0, arg1 interface{}) *gomock.Call

MatchEvent indicates an expected call of MatchEvent

type Option

type Option func(*Controller)

func AfterCommand

func AfterCommand(f ...AfterCommandFunc) Option

func BeforeCommand

func BeforeCommand(f ...BeforeCommandFunc) Option

func BeforeEvent

func BeforeEvent(f ...BeforeEventFunc) Option

func ErrorHandler

func ErrorHandler(f ...ErrorHandlerFunc) Option

func WithContext

func WithContext(ctx ...ContextFunc) Option

func WithErrorFormatter

func WithErrorFormatter(f ErrorFormatter) Option

type Sink

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

func NewSink

func NewSink() *Sink

func (*Sink) BeforeHandleEvent

func (s *Sink) BeforeHandleEvent(e stream.Event) stream.ID

func (*Sink) C

func (*Sink) Command

func (s *Sink) Command(ct stream.CommandType, h CommandHandlerFunc) *Sink

func (*Sink) CommandWithReply

func (s *Sink) CommandWithReply(ct stream.CommandType, h CommandWithReplyHandlerFunc) *Sink

func (*Sink) E

func (*Sink) Event

func (*Sink) From

func (s *Sink) From(ct stream.CommandType, h CommandHandlerFunc) *Sink

func (*Sink) HandleCommand

func (s *Sink) HandleCommand(ctx context.Context, cmd stream.Command, es stream.Stream) (*stream.Reply, error)

func (*Sink) HandleEvent

func (s *Sink) HandleEvent(ctx context.Context, e stream.Event, es stream.Stream) error

func (*Sink) MatchEvent

func (s *Sink) MatchEvent(_ context.Context, et stream.EventType) (ok bool)

type StreamFromEvent

type StreamFromEvent func(stream.Event) stream.ID

Jump to

Keyboard shortcuts

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