Documentation
¶
Index ¶
- func ValidateDimensions(dimensions []*model.Dimension) error
- func ValidateInstance(instance *model.Instance) error
- type CompletedProducer
- type InstanceEventHandler
- func (hdlr *InstanceEventHandler) Handle(ctx context.Context, newInstance event.NewInstance) error
- func (hdlr *InstanceEventHandler) SetOrderAndNodeIDs(ctx context.Context, instanceID string, dimensions []*model.Dimension) error
- func (hdlr *InstanceEventHandler) Validate(newInstance event.NewInstance) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDimensions ¶ added in v1.12.0
func ValidateInstance ¶ added in v1.12.0
Types ¶
type CompletedProducer ¶
type CompletedProducer interface {
Completed(ctx context.Context, e event.InstanceCompleted) error
}
CompletedProducer Producer kafka messages for instances that have been successfully processed.
type InstanceEventHandler ¶
type InstanceEventHandler struct { Store store.Storer DatasetAPICli *client.DatasetAPI Producer CompletedProducer BatchSize int EnablePatchNodeID bool }
InstanceEventHandler provides functions for handling DimensionsExtractedEvents.
func (*InstanceEventHandler) Handle ¶
func (hdlr *InstanceEventHandler) Handle(ctx context.Context, newInstance event.NewInstance) error
Handle retrieves the dimensions for specified instanceID from the Import API, creates an MyInstance entity for provided instanceID, creates a Dimension entity for each dimension and a relationship to the MyInstance it belongs to and makes a PUT request to the Import API with the database ID of each Dimension entity.
func (*InstanceEventHandler) SetOrderAndNodeIDs ¶ added in v1.12.0
func (hdlr *InstanceEventHandler) SetOrderAndNodeIDs(ctx context.Context, instanceID string, dimensions []*model.Dimension) error
SetOrderAndNodeIDs obtains the codes order from the graph database and patches the existing dimension options in dataset API (updating node_id and order values) this method assumes that valid non-nil values are provided (have been created or validated by caller)
func (*InstanceEventHandler) Validate ¶ added in v1.12.0
func (hdlr *InstanceEventHandler) Validate(newInstance event.NewInstance) error