event

package
v0.0.0-...-5bae4c0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	INSTANCE_VIEWPORT_RESIZE = EventType("instance viewport resize")
	INSTANCE_DELETE          = EventType("instance delete")
	INSTANCE_NEW             = EventType("instance new")
	INSTANCE_STATS           = EventType("instance stats")
	SESSION_NEW              = EventType("session new")
	SESSION_END              = EventType("session end")
	SESSION_READY            = EventType("session ready")
	SESSION_BUILDER_OUT      = EventType("session builder out")
	PLAYGROUND_NEW           = EventType("playground_new")
)

Functions

func NewLocalBroker

func NewLocalBroker() *localBroker

Types

type AnyHandler

type AnyHandler func(eventType EventType, id string, args ...interface{})

type EventApi

type EventApi interface {
	Emit(name EventType, id string, args ...interface{})
	On(name EventType, handler Handler)
	OnAny(handler AnyHandler)
}

type EventType

type EventType string

func (EventType) String

func (e EventType) String() string

type Handler

type Handler func(id string, args ...interface{})

type Mock

type Mock struct {
	M mock.Mock
}

func (*Mock) Emit

func (m *Mock) Emit(name EventType, sessionId string, args ...interface{})

func (*Mock) On

func (m *Mock) On(name EventType, handler Handler)

func (*Mock) OnAny

func (m *Mock) OnAny(handler AnyHandler)

Jump to

Keyboard shortcuts

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