eventers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventMiddleware

type EventMiddleware func(RawEvent) RawEvent

EventMiddleware is a type alias for easier middleware construction

type EventWriter

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

EventWriter is structure that satisfies the io.Writer interface. Its objective is to interpret written bytes and form them into events that can be recorded to the provided Recorder. EventWriter supports the concept of middleware, which enables some transformations to occur to the raw event.

func NewEventWriter

func NewEventWriter(rec recorders.Recorder, eventType common.EventType, middleware ...EventMiddleware) EventWriter

NewEventWriter is a constructor for an EventWriter

func (EventWriter) Write

func (e EventWriter) Write(p []byte) (n int, err error)

type RawEvent

type RawEvent struct {
	Data      []byte
	EventTime time.Time
	EventType common.EventType
	Error     error
	// contains filtered or unexported fields
}

RawEvent is a structure that can be sent to middleware to review/modify. The fields included are the basic components of an event, unmodified (specifically, Data, EventType, EventTime) TODO: should these be replaced with common.Event?

func (RawEvent) Dispatch

func (evt RawEvent) Dispatch()

Dispatch provides a mechanism to send the event off to its Recorder. This is present so that a caching mechanism can be enabled, or alternatively, allowing some middleware to dispatch an event so that other middleware cannot inspect it (if such a feature is needed)

Jump to

Keyboard shortcuts

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