event

package
v0.0.0-...-20b7b06 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2019 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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