handler

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddTopicWithParents added in v1.3.1

func AddTopicWithParents(ctx context.Context, slug, parentSlug string, topicCache *cache.TopicCache, uniqueTopics map[string]struct{})

AddTopicWithParents adds a topic and its parents to the uniqueTopics map if they don't already exist. It recursively adds parent topics until it reaches the root topic.

Types

type ContentPublished added in v0.24.0

type ContentPublished struct {
	Cfg        *config.Config
	Cache      cache.List
	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

type SearchContentHandler added in v1.5.0

type SearchContentHandler struct {
	Cfg      *config.Config
	Producer kafka.IProducer
}

func (*SearchContentHandler) Handle added in v1.5.0

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

Handle processes the search-content-updated event and generates messages.

Jump to

Keyboard shortcuts

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