events

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkspaceRequired = workspace.ErrRequired

ErrWorkspaceRequired reports a missing webhook event workspace.

Functions

func Payload

func Payload(event Event, now time.Time) (string, error)

Payload renders the event into the signed webhook delivery payload.

Types

type Event

type Event struct {
	Type        Type           `json:"type"`
	WorkspaceID string         `json:"workspace_id"`
	Data        map[string]any `json:"data,omitempty"`
}

Event is the shared webhook event envelope delivered to endpoints.

func NewQueueEmpty

func NewQueueEmpty(params QueueEmptyParams) (Event, error)

NewQueueEmpty returns a queue-empty webhook event for a workspace.

func NewTest

func NewTest(workspaceID string) (Event, error)

NewTest returns a test webhook event for a workspace.

type QueueEmptyParams

type QueueEmptyParams struct {
	WorkspaceID string
	QueueType   string
	SessionID   string
	Observer    string
	Observed    string
}

QueueEmptyParams carries queue-empty webhook event details.

type Type

type Type string

Type identifies a webhook event contract.

const (
	QueueEmpty Type = "queue.empty"
	Test       Type = "test.event"
)

Jump to

Keyboard shortcuts

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