events

package
v0.0.0-...-1f1d11f Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler func(topic EventName)

type EventManager

type EventManager interface {
	On(topic EventName, handler EventHandler) RegistrationId
	Emit(topic EventName)
	Remove(idToRemove RegistrationId)
}

func NewEventManager

func NewEventManager() EventManager

type EventName

type EventName string
const (
	TOPIC_SPACE_OPEN_STATE     EventName = "spaceOpen"
	TOPIC_RADSTELLE_OPEN_STATE EventName = "radstelleOpen"
	TOPIC_LAB_3D_OPEN_STATE    EventName = "lab3dOpen"
	TOPIC_MACHINING_OPEN_STATE EventName = "machining"

	TOPIC_SPACE_DEVICES EventName = "spaceDevices"
	TOPIC_POWER_USAGE   EventName = "powerUsage"
	TOPIC_FREIFUNK      EventName = "freifunk"
	TOPIC_WEATHER       EventName = "weather"

	TOPIC_MQTT      EventName = "mqtt"
	TOPIC_KEYHOLDER EventName = "keyholder"
)

func (EventName) StrValue

func (en EventName) StrValue() string

type RegistrationId

type RegistrationId uint

Jump to

Keyboard shortcuts

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