Documentation ¶
Index ¶
- type GetTopicsFunc
- type Projection
- func (p *Projection) ForceUpdate(ctx context.Context, resourceID *commands.ResourceId) error
- func (p *Projection) Models(resourceID *commands.ResourceId) []eventstore.Model
- func (p *Projection) Register(ctx context.Context, deviceID string) (created bool, err error)
- func (p *Projection) Unregister(deviceID string) error
- type TopicManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetTopicsFunc ¶
type Projection ¶
type Projection struct {
// contains filtered or unexported fields
}
Projection projects events from resource aggregate.
func NewProjection ¶
func NewProjection(ctx context.Context, name string, store eventstore.EventStore, subscriber eventbus.Subscriber, factoryModel eventstore.FactoryModelFunc) (*Projection, error)
NewProjection creates new resource projection.
func (*Projection) ForceUpdate ¶
func (p *Projection) ForceUpdate(ctx context.Context, resourceID *commands.ResourceId) error
ForceUpdate invokes update registered resource model from evenstore.
func (*Projection) Models ¶
func (p *Projection) Models(resourceID *commands.ResourceId) []eventstore.Model
Models returns models for device, resource or nil for non exist.
func (*Projection) Register ¶
Register registers deviceID, loads events from eventstore and subscribe to eventbus. It can be called multiple times for same deviceID but after successful the a call Unregister must be called same times to free resources.
func (*Projection) Unregister ¶
func (p *Projection) Unregister(deviceID string) error
Unregister unregisters device and his resource from projection.
type TopicManager ¶
type TopicManager struct {
// contains filtered or unexported fields
}
func NewTopicManager ¶
func NewTopicManager(getTopics GetTopicsFunc) *TopicManager
Click to show internal directories.
Click to hide internal directories.