Documentation
¶
Index ¶
- func NewEventMessage(aggregateID string, event interface{}, version *int, orderingKey string) ycq.EventMessage
- func NewPubsubEventBus(projectID, topic string) ycq.EventBus
- type AggregateDefinition
- type BaseGenericUnitOfWork
- func (uow *BaseGenericUnitOfWork) AcceptAllChanges()
- func (uow *BaseGenericUnitOfWork) CommitAllChanges(ctx context.Context, transaction interface{}) error
- func (uow *BaseGenericUnitOfWork) GetAggregateRepo(aggregateType reflect.Type) Repository
- func (uow *BaseGenericUnitOfWork) Load(typ reflect.Type, aggregateID string) (ycq.AggregateRoot, error)
- func (uow *BaseGenericUnitOfWork) Save(aggregate ycq.AggregateRoot, expectedVersion *int) error
- type EventMessage
- type Filter
- type GenericReadDB
- type GenericUnitOfWork
- type ItemFactory
- type Lease
- type LeasingService
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventMessage ¶
func NewEventMessage(aggregateID string, event interface{}, version *int, orderingKey string) ycq.EventMessage
func NewPubsubEventBus ¶
Types ¶
type AggregateDefinition ¶
type AggregateDefinition struct {
Constructor func(id string) ycq.AggregateRoot
Type reflect.Type
}
type BaseGenericUnitOfWork ¶
type BaseGenericUnitOfWork struct {
Repos map[string]Repository
sync.Mutex
}
func NewBaseGenericUnitOfWork ¶
func NewBaseGenericUnitOfWork() *BaseGenericUnitOfWork
func (*BaseGenericUnitOfWork) AcceptAllChanges ¶
func (uow *BaseGenericUnitOfWork) AcceptAllChanges()
func (*BaseGenericUnitOfWork) CommitAllChanges ¶
func (uow *BaseGenericUnitOfWork) CommitAllChanges(ctx context.Context, transaction interface{}) error
func (*BaseGenericUnitOfWork) GetAggregateRepo ¶
func (uow *BaseGenericUnitOfWork) GetAggregateRepo(aggregateType reflect.Type) Repository
func (*BaseGenericUnitOfWork) Load ¶
func (uow *BaseGenericUnitOfWork) Load(typ reflect.Type, aggregateID string) (ycq.AggregateRoot, error)
func (*BaseGenericUnitOfWork) Save ¶
func (uow *BaseGenericUnitOfWork) Save(aggregate ycq.AggregateRoot, expectedVersion *int) error
type EventMessage ¶
type EventMessage interface {
ycq.EventMessage
OrderingKey() string
}
type GenericReadDB ¶
type GenericReadDB interface {
SaveItem(transaction interface{}, id string, item interface{}) error
LoadAllItems() ([]interface{}, error)
LoadItem(id string) (interface{}, error)
DeleteItem(transaction interface{}, id string) error
UpdateItem(transaction interface{}, id string, updates interface{}) error
ListItems(filter []Filter, limit int) ([]interface{}, error)
}
type GenericUnitOfWork ¶
type GenericUnitOfWork interface {
GetAggregateRepo(aggregateType reflect.Type) Repository
Load(typ reflect.Type, aggregateID string) (ycq.AggregateRoot, error)
Save(aggregate ycq.AggregateRoot, expectedVersion *int) error
CommitAllChanges(ctx context.Context, transaction interface{}) error
AcceptAllChanges()
}
type ItemFactory ¶ added in v1.0.3
type ItemFactory func() interface{}
type LeasingService ¶
type Repository ¶
Click to show internal directories.
Click to hide internal directories.