event

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvroProducer

type AvroProducer struct {
	// contains filtered or unexported fields
}

AvroProducer produces Avro serialised messages.

func NewAvroProducer

func NewAvroProducer(kafkaProducer KafkaProducer) *AvroProducer

NewAvroProducer returns a new instance of AvroProducer.

func (*AvroProducer) HierarchyBuilt

func (producer *AvroProducer) HierarchyBuilt(ctx context.Context, instanceID, dimensionName string) error

HierarchyBuilt produces a new CSV exported event for the given filter output ID.

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

Consumer consumes event messages.

func NewConsumer

func NewConsumer() *Consumer

NewConsumer returns a new consumer instance.

func (*Consumer) Close

func (consumer *Consumer) Close(ctx context.Context) (err error)

Close safely closes the consumer and releases all resources

func (*Consumer) Consume

func (consumer *Consumer) Consume(ctx context.Context, messageConsumer MessageConsumer, handler Handler, errorReporter reporter.ErrorReporter)

Consume converts messages to event instances, and pass the event to the provided handler.

type DataImportCompleteHandler

type DataImportCompleteHandler struct {
	// contains filtered or unexported fields
}

DataImportCompleteHandler ...

func NewDataImportCompleteHandler

func NewDataImportCompleteHandler(hierarchyStore HierarchyStore, eventProducer EventProducer) *DataImportCompleteHandler

NewDataImportCompleteHandler ...

func (DataImportCompleteHandler) Handle

Handle takes a single event, and returns the observations gathered from the URL in the event.

type EventProducer

type EventProducer interface {
	HierarchyBuilt(ctx context.Context, instanceID, dimensionName string) error
}

EventProducer handles producing output events.

type Handler

type Handler interface {
	Handle(ctx context.Context, dataImportComplete *events.DataImportComplete) error
}

Handler represents a handler for processing a single event.

type HierarchyStore

type HierarchyStore interface {
	BuildHierarchy(instanceID, codeListID, dimensionName string) error
}

HierarchyStore provides storage functionality for hierarchy data

type KafkaProducer

type KafkaProducer interface {
	Channels() *kafka.ProducerChannels
	Close(ctx context.Context) (err error)
}

KafkaProducer represents the interface of a Kafka Producer

type MessageConsumer

type MessageConsumer interface {
	Channels() *kafka.ConsumerGroupChannels
}

MessageConsumer provides a generic interface for consuming []byte messages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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