projection

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContextKeyJobName = ContextKey("name")
	ContextKeyId      = ContextKey("id")
	ContextKeyRunId   = ContextKey("run-id")
)

Functions

This section is empty.

Types

type ContextKey added in v0.0.3

type ContextKey string

type Projector

type Projector interface {
	WithSchedules(bus event.Bus, store event.Store) Schedules
	HandleJob(projection.Job) error
}

type Registerer

type Registerer interface {
	// RegisterEventHandler registers an event handler for the given event name.
	RegisterEventHandler(eventName string, handler func(event.Event) error)
}

type Schedules

type Schedules = map[string]projection.Schedule

type Worker

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

func New

func New(bus event.Bus, store event.Store, reg *codec.Registry, opts ...WorkerOption) *Worker

func (*Worker) Start

func (svc *Worker) Start(ctx context.Context, opts ...projection.SubscribeOption) (<-chan error, error)

type WorkerOption

type WorkerOption func(*Worker)

func WithErrorFunc added in v0.0.3

func WithErrorFunc(fn func(projection.Job, error)) WorkerOption

func WithLogger

func WithLogger(logger *zap.SugaredLogger) WorkerOption

func WithProjector

func WithProjector(projector Projector) WorkerOption

func WithSchedules

func WithSchedules(schedules Schedules) WorkerOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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