axon_utils

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandAddPermits

func CommandAddPermits(amount int64, stream axon_server.CommandService_OpenStreamClient, clientId string)

func CommandRespond

func CommandRespond(stream axon_server.CommandService_OpenStreamClient, requestId string)

func ReportError

func ReportError(stream axon_server.CommandService_OpenStreamClient, requestId string, errorCode string, errorMessageText string)

func RestoreProjection

func RestoreProjection(label string, aggregateIdentifier string, createInitialProjection func() interface{}, clientConnection *ClientConnection, prepareUnmarshal func(payloadType string) Event) interface{}

func SendCommand

func SendCommand(commandType string, command proto.Message, clientConnection *ClientConnection) error

func Serve

func Serve(clientConnection *ClientConnection, registerWithServer func(*grpc.Server, *ClientConnection)) error

func SetCache

func SetCache(theCache Cache) error

func SubscribeCommand

func SubscribeCommand(commandName string, stream axon_server.CommandService_OpenStreamClient, clientInfo *axon_server.ClientIdentification)

Types

type AggregateState

type AggregateState interface {
	GetSequenceNumber() int64
	SetSequenceNumber(int64)
}

func NewAggregateState

func NewAggregateState() AggregateState

type Cache

type Cache interface {
	Get(string) (interface{}, bool)
	Put(string, interface{})
	Delete(string)
}

type CachedProjection

type CachedProjection interface {
	GetAggregateState() AggregateState
}

type ClientConnection

type ClientConnection struct {
	Connection *grpc.ClientConn
	ClientInfo *axon_server.ClientIdentification
}

func ProcessEvents

func ProcessEvents(labelPrefix string, host string, port int, processorName string, projection interface{}, prepareUnmarshal func(payloadType string) Event, tokenStore TokenStore) *ClientConnection

func WaitForServer

func WaitForServer(host string, port int, qualifier string) (*ClientConnection, *axon_server.PlatformService_OpenStreamClient)

type Error

type Error struct {
	Code                string
	Message             string
	AggregateIdentifier string
}

func AppendEvent

func AppendEvent(event Event, aggregateId string, projection interface{}, clientConnection *ClientConnection) (*Error, error)

type Event

type Event interface {
	proto.Message
	ApplyTo(projection interface{})
}

type NullTokenStore

type NullTokenStore struct{}

func (*NullTokenStore) ReadToken

func (tokenStore *NullTokenStore) ReadToken() *int64

func (*NullTokenStore) WriteToken

func (tokenStore *NullTokenStore) WriteToken(int64) error

type TokenStore

type TokenStore interface {
	ReadToken() *int64
	WriteToken(int64) error
}

Jump to

Keyboard shortcuts

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