webhook

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Upgrader = websocket.Upgrader{
	CheckOrigin: func(r *http.Request) bool { return true },
}

Functions

This section is empty.

Types

type Dispatcher

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

func NewDispatcher

func NewDispatcher(cfg *config.Config) *Dispatcher

func (*Dispatcher) AddWSClient

func (d *Dispatcher) AddWSClient(sessionID string, conn *websocket.Conn)

AddWSClient registers websocket connection for session.

func (*Dispatcher) CloseSession

func (d *Dispatcher) CloseSession(sessionID string)

CloseSession closes all websocket connections for session.

func (*Dispatcher) Emit

func (d *Dispatcher) Emit(sessionID, event string, data any)

func (*Dispatcher) RemoveWSClient

func (d *Dispatcher) RemoveWSClient(sessionID string, conn *websocket.Conn)

RemoveWSClient removes websocket connection.

type Event

type Event struct {
	SessionID string `json:"sessionId"`
	Event     string `json:"event"`
	Data      any    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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