cqrs

package
v0.0.0-...-7eeda50 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: MIT Imports: 1 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 interface {
	CommandID() string
}

Command defines command pattern interface.

type CompositeHandler

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

CompositeHandler a command bus.

func NewCompositeHandler

func NewCompositeHandler() *CompositeHandler

NewCompositeHandler creates a new instance of CompositeHandler.

func (*CompositeHandler) Handle

func (ch *CompositeHandler) Handle(c Command) error

Handle dispatches the given Command to its appropriate Handler and handles it.

func (*CompositeHandler) RegisterHandler

func (ch *CompositeHandler) RegisterHandler(commandID string, h Handler) *CompositeHandler

RegisterHandler registers a Handler for the given CommandID.

type Handler

type Handler interface {
	Handle(Command) error
}

Handler defines command handler pattern interface.

Jump to

Keyboard shortcuts

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