handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnsSearchIndex  = "ons"
	ZebedeeDataType = "legacy"
	DatasetDataType = "datasets"
)
View Source
const DefaultType = "dataset_landing_page"

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentPublished added in v0.24.0

type ContentPublished struct {
	Cfg        *config.Config
	ZebedeeCli clients.ZebedeeClient
	DatasetCli clients.DatasetClient
	Producer   kafka.IProducer
}

ContentPublished struct to hold handle for config with zebedee, datasetAPI client and the producer

func (*ContentPublished) Handle added in v0.24.0

func (h *ContentPublished) Handle(ctx context.Context, _ int, msg kafka.Message) error

Handle takes a single event and triages it according to its data type, which can be 'legacy' (zebedee) or 'datasets' If the type is not correct, the message is ignored with just a log.

type Error added in v0.24.0

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

Error is the handler package's error type. Is not meant to be compared as a type, but information should be extracted via the interfaces it implements with callback functions. Is not guaranteed to remain exported so shouldn't be treated as such.

func NewError added in v0.24.0

func NewError(err error, logData map[string]interface{}) *Error

NewError creates a new Error

func (*Error) Error added in v0.24.0

func (e *Error) Error() string

Error implements the Go standard error interface

func (*Error) LogData added in v0.24.0

func (e *Error) LogData() map[string]interface{}

LogData implements the DataLogger interface which allows you extract embedded log.Data from an error

func (*Error) Unwrap added in v0.24.0

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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