handler

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL