event

package
v0.4.0-dev2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventFormatter

type EventFormatter interface {
	// GetFormattedDetails formats a given event in a human-readable format
	GetFormattedDetails(context.Context, *esApi.Event) (string, error)
}

EventFormatter is the interface definition for all event formatters

type EventFormatterBase

type EventFormatterBase struct {
	*formatters.FormatterBase
}

EventFormatterBase is the base implementation for all event formatters

func (*EventFormatterBase) AppendUpdate

func (f *EventFormatterBase) AppendUpdate(field string, update string, old string, strBuilder *strings.Builder)

AppendUpdate appends updates to a string builder in human-readable format

type EventFormatterRegistry

type EventFormatterRegistry interface {
	// RegisterEventFormatter registers an event-formatter factory for an event-type.
	RegisterEventFormatter(es.EventType, func(esApi.EventStoreClient) EventFormatter) error
	// CreateEventFormatter returns the event-formatter of the event-type registered with RegisterEventFormatter.
	CreateEventFormatter(esApi.EventStoreClient, es.EventType) (EventFormatter, error)
}

EventFormatterRegistry is the interface definition for an event-formatter registry

var DefaultEventFormatterRegistry EventFormatterRegistry

func NewEventFormatterRegistry

func NewEventFormatterRegistry() EventFormatterRegistry

NewEventFormatterRegistry creates a new event-formatter registry

Jump to

Keyboard shortcuts

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