Documentation ¶
Index ¶
- Variables
- func NanoidGenerator(alphabet string, size int) string
- func UUIDGenerator(_ string, _ int) string
- type AggregateCluster
- func (r *AggregateCluster) Apply(evt event.Eventer) error
- func (r *AggregateCluster) ApplyCommitted(evt event.Eventer) error
- func (r *AggregateCluster) Commit(evt event.Eventer) error
- func (r *AggregateCluster) GetId() string
- func (r *AggregateCluster) GetType() string
- func (r *AggregateCluster) GetVersion() event.Version
- func (r *AggregateCluster) ListCommittedEvents() []event.Eventer
- func (r *AggregateCluster) ListUncommittedEvents() []event.Eventer
- func (r *AggregateCluster) SetId(id string)
- func (r *AggregateCluster) SetType(typ string)
- func (r *AggregateCluster) SetVersion(version event.Version)
- type IDGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEventDuplication = errors.New("event duplication, event is already exist")
Functions ¶
func NanoidGenerator ¶
func UUIDGenerator ¶
Types ¶
type AggregateCluster ¶
type AggregateCluster struct {
// contains filtered or unexported fields
}
func New ¶
func New(agg event.Aggregator, transition event.Transition, idgenfn IDGenerator) *AggregateCluster
func (*AggregateCluster) Apply ¶
func (r *AggregateCluster) Apply(evt event.Eventer) error
Apply applies not committed yet event. The event Id, Type, Version will be replaced with current AggregateCluster Id, Type and Version.
func (*AggregateCluster) ApplyCommitted ¶
func (r *AggregateCluster) ApplyCommitted(evt event.Eventer) error
ApplyCommitted applies already committed event. The AggregateCluster state id, type, version will be replaced with current event id, type and version.
func (*AggregateCluster) Commit ¶
func (r *AggregateCluster) Commit(evt event.Eventer) error
Commit commits event and deletes from committed events list.
func (*AggregateCluster) GetId ¶
func (r *AggregateCluster) GetId() string
func (*AggregateCluster) GetType ¶
func (r *AggregateCluster) GetType() string
func (*AggregateCluster) GetVersion ¶
func (r *AggregateCluster) GetVersion() event.Version
func (*AggregateCluster) ListCommittedEvents ¶
func (r *AggregateCluster) ListCommittedEvents() []event.Eventer
ListCommittedEvents returns a list of already committed events.
func (*AggregateCluster) ListUncommittedEvents ¶
func (r *AggregateCluster) ListUncommittedEvents() []event.Eventer
ListUncommittedEvents returns a list of not committed yet events.
func (*AggregateCluster) SetId ¶
func (r *AggregateCluster) SetId(id string)
func (*AggregateCluster) SetType ¶
func (r *AggregateCluster) SetType(typ string)
func (*AggregateCluster) SetVersion ¶
func (r *AggregateCluster) SetVersion(version event.Version)
type IDGenerator ¶
IDGenerator is a function that generates random a string. Uses passed alphabet to generate a string only from provided characters and for predefined size.
Click to show internal directories.
Click to hide internal directories.