webhooksubs

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Missing any = missingSubscription{}

Sentinel expected value of Replace for a route that must not exist yet

Functions

func ApplyPlain

func ApplyPlain(dst *pyjson.Object, plain map[string]any)

Writes a plain map mutation back into the ordered snapshot, surviving keys in file order and new keys sorted after

func BaseURL

func BaseURL(ctx context.Context, h string) string

Local base URL of the webhook listener, wildcard hosts shown as localhost and IPv6 bracketed

func Load

func Load(h string) *pyjson.Object

Lock free read, writers publish by atomic rename so a reader always sees one whole snapshot

func LoadUnlocked

func LoadUnlocked(h string) *pyjson.Object

One complete store snapshot in file order, unreadable or malformed files reading as empty

func Lock

func Lock(h string) (func(), error)

Takes the thread lock then the store file lock and returns their release

func LockPath

func LockPath(h string) string

Lock file beside the subscription store

func Mutate

func Mutate(h string, mutate func(subs *pyjson.Object) error) error

Locks, rereads, mutates and atomically publishes one snapshot, an error from mutate publishing nothing

func Path

func Path(h string) string

Subscription store file of the home

func Replace

func Replace(h, name string, route *pyjson.Object, expected any) (*pyjson.Object, error)

Swaps one route only when it still equals expected, keeping an explicit enabled false, and returns it as published

func RouteURL

func RouteURL(ctx context.Context, h, name string, route *pyjson.Object) string

Delivery URL of one route, prefixed with /p/<profile> for a non default profile

func SaveUnlocked

func SaveUnlocked(h string, subs *pyjson.Object) error

Publishes the snapshot atomically as two space indented JSON with owner only mode

func WebhookConfig

func WebhookConfig(ctx context.Context, h string) map[string]any

The platforms.webhook config mapping with the WEBHOOK_ENABLED, WEBHOOK_PORT and WEBHOOK_SECRET layer the gateway applies

func WebhookEnabled

func WebhookEnabled(ctx context.Context, h string) bool

Whether the webhook platform is enabled in the home config

Types

type LockUnavailableError

type LockUnavailableError struct {
	Path string
	Err  error
}

Lock file that could not be opened or locked, the RuntimeError of the file lock

func (*LockUnavailableError) Error

func (e *LockUnavailableError) Error() string

func (*LockUnavailableError) Unwrap

func (e *LockUnavailableError) Unwrap() error

type SubscriptionMutationConflict

type SubscriptionMutationConflict struct{ Msg string }

Route changed after the caller took the snapshot it meant to replace

func (*SubscriptionMutationConflict) Error

func (*SubscriptionMutationConflict) PyTypeName

func (e *SubscriptionMutationConflict) PyTypeName() string

Python exception class name the error stands for

Jump to

Keyboard shortcuts

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