event

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Type() EventType
	OriginTime() time.Time
}

type EventType

type EventType string
const (
	SwitchMachineAdded   EventType = "Switch-Machine-Added"
	SwitchMachineRemoved EventType = "Switch-Machine-Removed"
	//Update of Position, Motor, or GPIO
	SwitchMachineUpdated EventType = "Switch-Machine-Updated"
)

type SwitchMachineEvent

type SwitchMachineEvent interface {
	Event
	State() switchmachine.State
}

func NewSwitchMachineAddedEvent

func NewSwitchMachineAddedEvent(newState switchmachine.State) SwitchMachineEvent

func NewSwitchMachineRemovedEvent

func NewSwitchMachineRemovedEvent(lastState switchmachine.State) SwitchMachineEvent

func NewSwitchMachineUpdatedEvent

func NewSwitchMachineUpdatedEvent(newState switchmachine.State) SwitchMachineEvent

type SwitchMachineEventListener

type SwitchMachineEventListener interface {
	HandleSwitchMachineEvent(SwitchMachineEvent)
}

Jump to

Keyboard shortcuts

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