handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command[C any] interface {
	Handle(ctx context.Context, cmd C) error
}

type MockCommand

type MockCommand[C interface{}] struct {
	mock.Mock
}

MockCommand is an autogenerated mock type for the Command type

func NewMockCommand

func NewMockCommand[C interface{}](t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCommand[C]

NewMockCommand creates a new instance of MockCommand. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCommand[C]) Handle

func (_m *MockCommand[C]) Handle(ctx context.Context, cmd C) error

Handle provides a mock function with given fields: ctx, cmd

type MockQuery

type MockQuery[Q interface{}, R interface{}] struct {
	mock.Mock
}

MockQuery is an autogenerated mock type for the Query type

func NewMockQuery

func NewMockQuery[Q interface{}, R interface{}](t interface {
	mock.TestingT
	Cleanup(func())
}) *MockQuery[Q, R]

NewMockQuery creates a new instance of MockQuery. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockQuery[Q, R]) Handle

func (_m *MockQuery[Q, R]) Handle(ctx context.Context, qry Q) (R, error)

Handle provides a mock function with given fields: ctx, qry

type Query

type Query[Q any, R any] interface {
	Handle(ctx context.Context, qry Q) (R, error)
}

Jump to

Keyboard shortcuts

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