bus

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package bus is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch[Q objectIn, T objectOut](ctx context.Context, dto Q) (T, error)

func DispatchAsync

func DispatchAsync[Q objectIn, T objectOut](ctx context.Context, dto Q) <-chan Envelope[T]

func Register

func Register[Q objectIn, T objectOut](q Q, handler Command[Q, T])

Types

type Command

type Command[Q objectIn, T objectOut] interface {
	Execute(ctx context.Context, dto Q) (T, error)
}

type Envelope

type Envelope[T objectOut] struct {
	Result T
	Error  error
}

type MockCommand

type MockCommand[Q objectIn, T objectOut] struct {
	// contains filtered or unexported fields
}

MockCommand is a mock of Command interface.

func NewMockCommand

func NewMockCommand[Q objectIn, T objectOut](ctrl *gomock.Controller) *MockCommand[Q, T]

NewMockCommand creates a new mock instance.

func (*MockCommand[Q, T]) EXPECT

func (m *MockCommand[Q, T]) EXPECT() *MockCommandMockRecorder[Q, T]

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

func (*MockCommand[Q, T]) Execute

func (m *MockCommand[Q, T]) Execute(ctx context.Context, dto Q) (T, error)

Invoke mocks base method.

type MockCommandMockRecorder

type MockCommandMockRecorder[Q objectIn, T objectOut] struct {
	// contains filtered or unexported fields
}

MockCommandMockRecorder is the mock recorder for MockCommand.

func (*MockCommandMockRecorder[Q, T]) Invoke

func (mr *MockCommandMockRecorder[Q, T]) Invoke(ctx, dto any) *gomock.Call

Invoke indicates an expected call of Invoke.

Jump to

Keyboard shortcuts

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