hooks

package
v0.0.0-...-d246b70 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUninitialized = errors.New("store_empty")
)

Functions

This section is empty.

Types

type Event

type Event struct {
	Name string
	Fn   EventHandler
}

type EventEmitter

type EventEmitter interface {
	On(eventName string, handler EventHandler)
	Off(eventName string)
	Emit(eventName string, args ...interface{}) Result
}

type EventHandler

type EventHandler func(args ...interface{}) Result

type EventStore

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

func NewEventStore

func NewEventStore() *EventStore

func (*EventStore) Emit

func (e *EventStore) Emit(event string, data ...interface{}) Result

func (*EventStore) Off

func (e *EventStore) Off(event string)

func (*EventStore) On

func (e *EventStore) On(name string, fn EventHandler)

type Result

type Result struct {
	Data interface{}
	Err  error
}

Jump to

Keyboard shortcuts

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