mediator

package
v1.2.38 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandResponse

type CommandResponse interface {
}

type Handler

type Handler interface {
	Handle(ctx context.Context, cmd Message) (interface{}, error)
}

type Mediator

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

func New

func New(options ...Option) (*Mediator, error)

func (*Mediator) Send

func (m *Mediator) Send(ctx context.Context, command Message) (interface{}, error)

type Message

type Message interface {
	Key() string
}

type Option

type Option func(*Mediator) error

func WithHandler

func WithHandler(command Message, handler Handler) Option

Jump to

Keyboard shortcuts

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