testagg

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package eventstore is a generated protocol buffer package.

It is generated from these files:

testaggcreated.proto
testupdatefoo.proto

It has these top-level messages:

TestAggCreated
TestAggFooUpdated

Index

Constants

View Source
const (
	TestAggCreatedTypeCode   = "TACRE"
	TestAggFooUpdateTypeCode = "TAFU"
)

The constants are used as unmarshalling hints when reconstructing the aggregate from its event history

Variables

View Source
var ErrUnknownType = errors.New("Unknown event type")

Functions

This section is empty.

Types

type TestAgg

type TestAgg struct {
	*goes.Aggregate
	Foo string
	Bar string
	Baz string
}

The aggregate for our example. In addition to the aggregate type, we need to capture the commands associated with the aggregate (implemented as exported methods that route events) and event types that are used to apply the state mutations.

func NewTestAgg

func NewTestAgg(foo, bar, baz string) (*TestAgg, error)

Factory method for instantiating the aggregate, which is also the command method for 'create'

func NewTestAggFromHistory

func NewTestAggFromHistory(events []goes.Event) *TestAgg

Factory method for recreating the aggregate state from the event history

func (*TestAgg) Apply

func (ta *TestAgg) Apply(event goes.Event)

The required apply method, called only from commands to route and record events

func (*TestAgg) Route

func (ta *TestAgg) Route(event goes.Event)

The required route method to route events to their handlers. Note the handlers may only change state - no other side effects are allowed.

func (*TestAgg) Store

func (ta *TestAgg) Store(eventStore goes.EventStore) error

Required implementation of the Store method.

func (*TestAgg) UpdateFoo

func (ta *TestAgg) UpdateFoo(newfoo string)

Command method for updating the foo attribute

type TestAggCreated

type TestAggCreated struct {
	AggregateId string `protobuf:"bytes,1,opt,name=aggregateId" json:"aggregateId,omitempty"`
	Foo         string `protobuf:"bytes,2,opt,name=foo" json:"foo,omitempty"`
	Bar         string `protobuf:"bytes,3,opt,name=bar" json:"bar,omitempty"`
	Baz         string `protobuf:"bytes,4,opt,name=baz" json:"baz,omitempty"`
}

func (*TestAggCreated) Descriptor

func (*TestAggCreated) Descriptor() ([]byte, []int)

func (*TestAggCreated) ProtoMessage

func (*TestAggCreated) ProtoMessage()

func (*TestAggCreated) Reset

func (m *TestAggCreated) Reset()

func (*TestAggCreated) String

func (m *TestAggCreated) String() string

type TestAggFooUpdated

type TestAggFooUpdated struct {
	AggregateId string `protobuf:"bytes,1,opt,name=aggregateId" json:"aggregateId,omitempty"`
	NewFoo      string `protobuf:"bytes,2,opt,name=newFoo" json:"newFoo,omitempty"`
}

func (*TestAggFooUpdated) Descriptor

func (*TestAggFooUpdated) Descriptor() ([]byte, []int)

func (*TestAggFooUpdated) ProtoMessage

func (*TestAggFooUpdated) ProtoMessage()

func (*TestAggFooUpdated) Reset

func (m *TestAggFooUpdated) Reset()

func (*TestAggFooUpdated) String

func (m *TestAggFooUpdated) String() string

Jump to

Keyboard shortcuts

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