eventserver

package
v0.0.0-...-55a3b1d Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSubscription

func NewSubscription(logic EventHandlerFunc, interests ...EventType) *subscription

Types

type Event

type Event struct {
	Type    EventType
	Payload interface{}
}

type EventDispatch

type EventDispatch interface {
	Send(event Event)
}

type EventHandlerFunc

type EventHandlerFunc func(eventC <-chan Event, exitC chan struct{})

type EventType

type EventType string
const (
	All                       EventType = "all events"
	MonitorAlerted            EventType = "monitor alerted"
	MonitorAlertStatusChanged EventType = "monitor alert status changed"
	MonitorExitingAlert       EventType = "monitor exiting alert"
	MonitorNewEvent           EventType = "new monitor event"
	MonitorEventUploaded      EventType = "new event uploaded"
	MonitorEventRecorded      EventType = "event saved in recordkeeper"
)

type SubscriptionManager

type SubscriptionManager interface {
	Register(handler EventHandlerFunc, eventInterests ...EventType)
	EventDispatch
}

func NewDispatch

func NewDispatch(manager *service.Manager) SubscriptionManager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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