event

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(event StoppableEvent)

Types

type Dispatcher

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

func GetDispatcher

func GetDispatcher() *Dispatcher

func NewDispatcher

func NewDispatcher() *Dispatcher

func (*Dispatcher) Bind

func (p *Dispatcher) Bind(eventName string, listeners ...Listener)

func (*Dispatcher) BindBatch

func (p *Dispatcher) BindBatch(eventName string, listeners []Listener)

func (*Dispatcher) Dispatch

func (p *Dispatcher) Dispatch(event StoppableEvent)

type DispatcherEvent

type DispatcherEvent interface {
	Dispatch(event *StoppableEvent)
}

type Event

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

func (*Event) Continue

func (p *Event) Continue()

func (*Event) IsPropagationStopped

func (p *Event) IsPropagationStopped() bool

func (*Event) Stop

func (p *Event) Stop()

type Listener

type Listener interface {
	Listen(event *StoppableEvent)
}

type StoppableEvent

type StoppableEvent interface {
	Name() string
	IsPropagationStopped() bool
	Stop()
	Continue()
}

Jump to

Keyboard shortcuts

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