commandbus

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 2 Imported by: 0

README

commandbus GoDoc

Package commandbus provides command bus interfaces

Download:

go get -u github.com/bradishungry/go-api-learning/pkg/commandbus

Package commandbus provides command bus interfaces

Documentation

Overview

Package commandbus provides interfaces along with helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBus

type CommandBus interface {
	Publish(ctx context.Context, command domain.Command) error
	Subscribe(ctx context.Context, commandName string, fn CommandHandler) error
	Unsubscribe(ctx context.Context, commandName string) error
}

CommandBus allows to subscribe/dispatch commands Subscribing to the same command twice will unsubscribe previous handler command handler should be one to one

type CommandHandler

type CommandHandler func(ctx context.Context, command domain.Command) error

CommandHandler function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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