Documentation ¶
Index ¶
- type GetTopicsFunc
- type Projection
- func (p *Projection) ForceUpdate(ctx context.Context, deviceId, resourceId string) error
- func (p *Projection) Models(deviceId, resourceId string) []eventstore.Model
- func (p *Projection) Register(ctx context.Context, deviceId string) (loaded bool, err error)
- func (p *Projection) Unregister(deviceId string) error
- type RefCountMap
- 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, deviceId, resourceId string) error
ForceUpdate invokes update registered resource model from evenstore.
func (*Projection) Models ¶
func (p *Projection) Models(deviceId, resourceId string) []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 RefCountMap ¶
type RefCountMap struct {
// contains filtered or unexported fields
}
func NewRefCountMap ¶
func NewRefCountMap() *RefCountMap
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.