event

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: GPL-3.0 Imports: 6 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 struct {
	// contains filtered or unexported fields
}

func NewEmitter

func NewEmitter(pipelines ...IPipeline) *Emitter

func (*Emitter) AddPipeline

func (e *Emitter) AddPipeline(p IPipeline)

Add a pipeline in which to send events

func (*Emitter) Commit

func (e *Emitter) Commit()

func (Emitter) Dispose

func (s Emitter) Dispose()

func (Emitter) OnAuthentication

func (s Emitter) OnAuthentication()

func (Emitter) OnException

func (s Emitter) OnException()

func (*Emitter) OnSuccess

func (s *Emitter) OnSuccess()

func (*Emitter) Send

func (e *Emitter) Send(evt Event)

type Event

type Event struct {
	Topic       string
	Type        string
	Action      string
	EntityType  string
	EntityKeys  []string
	ResourceUrl string

	// This is only important event info, not the entire event payload
	// The entire event payload can be fetched from "ResourceUrl"
	Data any // TODO: maybe a struct array with EntityKey and data
}

type IPipeline

type IPipeline interface {
	OnEvent(events []Event) //next func() []Event
}

Jump to

Keyboard shortcuts

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