event

package
v0.0.4-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus[T any] interface {
	Getlisteners() []chan T
	RegisterListener(listener chan T)
	EmitEvent(event T)
	UnregisterListener(listener chan T)
}

type EventListener

type EventListener[T any] func(conn *websocket.Conn, event T)

EventListener is the type of the function that handles events

type Variable

type Variable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type VariableChangeEvent

type VariableChangeEvent struct {
	FunctionName string                          `json:"function_name"`
	VariableType VariableChangeEventVariableType `json:"type"`
	Variables    []*Variable                     `json:"variables"`
}

func NewVariableChangeEvent

func NewVariableChangeEvent(functionName string, variableType VariableChangeEventVariableType, variables []*proc.Variable) *VariableChangeEvent

type VariableChangeEventBus

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

func GetVariableChangeEventBus

func GetVariableChangeEventBus() *VariableChangeEventBus

func (*VariableChangeEventBus) EmitEvent

func (eb *VariableChangeEventBus) EmitEvent(event *VariableChangeEvent)

func (*VariableChangeEventBus) RegisterListener

func (eb *VariableChangeEventBus) RegisterListener(listener chan *VariableChangeEvent)

func (*VariableChangeEventBus) UnregisterListener

func (eb *VariableChangeEventBus) UnregisterListener(listener chan *VariableChangeEvent)

type VariableChangeEventVariableType

type VariableChangeEventVariableType int
const (
	VariableTypeArgument VariableChangeEventVariableType = iota
	VariableTypeReturnValue
)

Jump to

Keyboard shortcuts

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