rabbitmq

package
v0.0.0-...-b6b6a87 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBus

type CommandBus struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

func NewCommandBus

func NewCommandBus(connectionURL string) (*CommandBus, error)

func (*CommandBus) Close

func (c *CommandBus) Close() error

func (*CommandBus) Dispatch

func (c *CommandBus) Dispatch(ctx context.Context, command command.Command) error

func (*CommandBus) Register

func (c *CommandBus) Register(t command.Type, handler command.Handler)

type EventBus

type EventBus struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

EventBus is an in-memory implementation of the event.Bus.

func NewEventBus

func NewEventBus(connectionURL string) (*EventBus, error)

NewEventBus initializes a new EventBus.

func (*EventBus) Close

func (b *EventBus) Close() error

func (*EventBus) Publish

func (b *EventBus) Publish(ctx context.Context, events []event.Event) error

Publish implements the event.Bus interface.

func (*EventBus) Subscribe

func (b *EventBus) Subscribe(evtType event.Type, handler event.Handler)

Subscribe implements the event.Bus interface.

Jump to

Keyboard shortcuts

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