rabbit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rabbit provides an event and command bus for the CQRS and Event Sourcing framework

Current version: experimental

Index

Constants

This section is empty.

Variables

View Source
var Prefetch = 100

Prefetch amount of messages to prefetch

Functions

This section is empty.

Types

type CommandBus

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

CommandBus ...

func NewCommandBus

func NewCommandBus(resolver ConnectionStringResolver, name string, exchange string) *CommandBus

NewCommandBus will create a new command bus

func (*CommandBus) PublishCommands

func (bus *CommandBus) PublishCommands(commands []cqrs.Command) error

PublishCommands will publish commands

func (*CommandBus) ReceiveCommands

func (bus *CommandBus) ReceiveCommands(options cqrs.CommandReceiverOptions) error

ReceiveCommands will recieve commands

type ConnectionStringResolver added in v1.0.0

type ConnectionStringResolver func() (string, error)

ConnectionStringResolver is a function that dynamically returns a connection string

type EventBus

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

EventBus ...

func NewEventBus

func NewEventBus(resolver ConnectionStringResolver, name string, exchange string) *EventBus

NewEventBus ...

func (*EventBus) DeleteQueue

func (bus *EventBus) DeleteQueue(name string) error

DeleteQueue will delete a queue

func (*EventBus) PublishEvents

func (bus *EventBus) PublishEvents(events []cqrs.VersionedEvent) error

PublishEvents will publish events

func (*EventBus) ReceiveEvents

func (bus *EventBus) ReceiveEvents(options cqrs.VersionedEventReceiverOptions) error

ReceiveEvents will receive events

type RawCommand

type RawCommand struct {
	MessageID     string    `json:"messageID"`
	CorrelationID string    `json:"correlationID"`
	CommandType   string    `json:"commandType"`
	Created       time.Time `json:"time"`
	Body          json.RawMessage
}

RawCommand represents an actor intention to alter the state of the system

type RawVersionedEvent

type RawVersionedEvent struct {
	ID            string    `json:"id"`
	CorrelationID string    `json:"correlationID"`
	SourceID      string    `json:"sourceID"`
	Version       int       `json:"version"`
	EventType     string    `json:"eventType"`
	Created       time.Time `json:"time"`
	Event         json.RawMessage
}

RawVersionedEvent ...

Jump to

Keyboard shortcuts

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