frameworkevent

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 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 Emitter

type Emitter interface {
	Emit(ctx xcontext.Context, event Event) error
}

Emitter defines the interface that emitter objects for framework vents must implement

type EmitterFetcher

type EmitterFetcher interface {
	Emitter
	Fetcher
}

EmitterFetcher defines the interface that objects supporting emitting and retrieving framework events must implement

type Event

type Event struct {
	// SequenceID represents an ordering parameter between events of the same job
	SequenceID uint64
	JobID      types.JobID
	EventName  event.Name
	Payload    *json.RawMessage
	EmitTime   time.Time
}

Event represents an event emitted by the framework

func New

func New() Event

New creates a new FrameworkEvent

type Fetcher

type Fetcher interface {
	Fetch(ctx xcontext.Context, fields ...QueryField) ([]Event, error)
}

Fetcher defines the interface that fetcher objects for framework events must implement

type Query

type Query struct {
	event.Query
}

Query wraps information that are used to build event queries for framework events

func BuildQuery

func BuildQuery(queryFields ...QueryField) (*Query, error)

BuildQuery compiles a Query from scratch using values of queryFields. It does basically just creates an empty query an applies queryFields to it.

type QueryField

type QueryField interface {
	// contains filtered or unexported methods
}

QueryField defines a function type used to set a field's value on Query objects

func QueryEmittedEndTime

func QueryEmittedEndTime(emittedEndTime time.Time) QueryField

QueryEmittedEndTime sets the EmittedEndTime field of the Query object

func QueryEmittedStartTime

func QueryEmittedStartTime(emittedStartTime time.Time) QueryField

QueryEmittedStartTime sets the EmittedStartTime field of the Query object

func QueryEventName

func QueryEventName(eventName event.Name) QueryField

QueryEventName sets a single EventName field in the Query object

func QueryEventNames

func QueryEventNames(eventNames []event.Name) QueryField

QueryEventNames the EventNames field of the Query object

func QueryJobID

func QueryJobID(jobID types.JobID) QueryField

QueryJobID sets the JobID field of the Query object

type QueryFields

type QueryFields []QueryField

QueryFields is a set of field values for a Query object

func (QueryFields) BuildQuery

func (queryFields QueryFields) BuildQuery() (*Query, error)

BuildQuery compiles a Query from scratch using values of queryFields. It does basically just creates an empty query an applies queryFields to it.

Jump to

Keyboard shortcuts

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