About

Get Started

Docs

events

import "github.com/gosolid/solid/pkg/runtime/events"

Index

type EventEmitter

type EventEmitter interface {
    AddListener(ctx context.Context, eventName string, listener *isolates.Value) error
    AddListenerOnce(ctx context.Context, eventName string, listener *isolates.Value) error
    Emit(ctx context.Context, eventName string, args ...any) error
    EmitError(ctx context.Context, err error) error
    EmitErrorValue(ctx context.Context, err *isolates.Value) error
    EventNames() []string
    GetMaxListeners() int
    SetMaxListeners(maxListeners int)
    ListenerCount(ctx context.Context, eventName string, listener *isolates.Value) (int, error)
    Listeners(eventName string) []*isolates.Value
    RemoveListener(ctx context.Context, eventName string, listener *isolates.Value) error
    RemoveAllListeners(in isolates.FunctionArgs) error
    PrependListener(ctx context.Context, eventName string, listener *isolates.Value) error
    PrependListenerOnce(ctx context.Context, eventName string, listener *isolates.Value) error
}

type EventEmitterBase

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

func NewEventEmitter

func NewEventEmitter(in isolates.FunctionArgs) *EventEmitterBase

func (*EventEmitterBase) AddListener

func (e *EventEmitterBase) AddListener(ctx context.Context, eventName string, listener *isolates.Value) error

func (*EventEmitterBase) AddListenerOnce

func (e *EventEmitterBase) AddListenerOnce(ctx context.Context, eventName string, listener *isolates.Value) error

func (*EventEmitterBase) Emit

func (e *EventEmitterBase) Emit(ctx context.Context, eventName string, args ...any) error

func (*EventEmitterBase) EmitError

func (e *EventEmitterBase) EmitError(ctx context.Context, err error) error

func (*EventEmitterBase) EmitErrorValue

func (e *EventEmitterBase) EmitErrorValue(ctx context.Context, err *isolates.Value) error

func (*EventEmitterBase) EventNames

func (e *EventEmitterBase) EventNames() []string

func (*EventEmitterBase) GetMaxListeners

func (e *EventEmitterBase) GetMaxListeners() int

func (*EventEmitterBase) ListenerCount

func (e *EventEmitterBase) ListenerCount(ctx context.Context, eventName string, listener *isolates.Value) (int, error)

func (*EventEmitterBase) Listeners

func (e *EventEmitterBase) Listeners(eventName string) []*isolates.Value

func (*EventEmitterBase) PrependListener

func (e *EventEmitterBase) PrependListener(ctx context.Context, eventName string, listener *isolates.Value) error

func (*EventEmitterBase) PrependListenerOnce

func (e *EventEmitterBase) PrependListenerOnce(ctx context.Context, eventName string, listener *isolates.Value) error

func (*EventEmitterBase) RemoveAllListeners

func (e *EventEmitterBase) RemoveAllListeners(in isolates.FunctionArgs) error

func (*EventEmitterBase) RemoveListener

func (e *EventEmitterBase) RemoveListener(ctx context.Context, eventName string, listener *isolates.Value) error

func (*EventEmitterBase) SetMaxListeners

func (e *EventEmitterBase) SetMaxListeners(maxListeners int)

func (*EventEmitterBase) V8Construct

func (e *EventEmitterBase) V8Construct(in isolates.FunctionArgs) (*EventEmitterBase, error)

func (*EventEmitterBase) V8FuncAddListener

func (e *EventEmitterBase) V8FuncAddListener(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncEmit

func (e *EventEmitterBase) V8FuncEmit(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncEventNames

func (e *EventEmitterBase) V8FuncEventNames(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncGetMaxListeners

func (e *EventEmitterBase) V8FuncGetMaxListeners(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncListenerCount

func (e *EventEmitterBase) V8FuncListenerCount(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncListeners

func (e *EventEmitterBase) V8FuncListeners(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncOff

func (e *EventEmitterBase) V8FuncOff(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncOn

func (e *EventEmitterBase) V8FuncOn(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncOnce

func (e *EventEmitterBase) V8FuncOnce(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncPrependListener

func (e *EventEmitterBase) V8FuncPrependListener(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncPrependListenerOnce

func (e *EventEmitterBase) V8FuncPrependListenerOnce(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncRawListeners

func (e *EventEmitterBase) V8FuncRawListeners(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncRemoveAllListeners

func (e *EventEmitterBase) V8FuncRemoveAllListeners(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncRemoveListener

func (e *EventEmitterBase) V8FuncRemoveListener(in isolates.FunctionArgs) (*isolates.Value, error)

func (*EventEmitterBase) V8FuncSetMaxListeners

func (e *EventEmitterBase) V8FuncSetMaxListeners(in isolates.FunctionArgs) (*isolates.Value, error)

type EventHandler

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

func (*EventHandler) Add

func (h *EventHandler) Add(callback func(...any) error) func()

func (*EventHandler) Emit

func (h *EventHandler) Emit(args ...any) error

Up next

fs