event

package
v0.0.0-...-fd752eb Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DataChannelSize ...
	DataChannelSize = 1000
	// SignalChannelSize ...
	SignalChannelSize = 1
)

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection ...

func NewCollection

func NewCollection() *Collection

NewCollection ...

func (*Collection) Event

func (m *Collection) Event(event Event) *HandlerList

Event ...

type Data

type Data interface{}

Data data

type Event

type Event interface {
	Type() Type
}

Event ...

func Default

func Default(name string) Event

Default default event

type Handler

type Handler interface {
	Publish(Event, Data)
}

Handler ...

func BoolDataHandler

func BoolDataHandler(h func(Event, bool)) Handler

BoolDataHandler null handler

func NullDataHandler

func NullDataHandler(h func(Event)) Handler

NullDataHandler null handler

func StrDataHandler

func StrDataHandler(h func(Event, string)) Handler

StrDataHandler null handler

type HandlerList

type HandlerList struct {
	// contains filtered or unexported fields
}

HandlerList ...

func (*HandlerList) Publish

func (h *HandlerList) Publish(data Data)

Publish publish to event

func (*HandlerList) Stop

func (h *HandlerList) Stop(id int) error

Stop ...

func (*HandlerList) Subscribe

func (h *HandlerList) Subscribe(handler Handler) int

Subscribe subscribe to event

func (*HandlerList) Subscriber

func (h *HandlerList) Subscriber(id int) (bool, error)

Subscriber ...

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager ...

func New

func New() *Manager

New ...

func (Manager) Type

func (m Manager) Type(namespace string) *Collection

Type ...

type Type

type Type string

Type event type

Jump to

Keyboard shortcuts

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