Documentation
¶
Index ¶
- Variables
- func ApplyPlain(dst *pyjson.Object, plain map[string]any)
- func BaseURL(ctx context.Context, h string) string
- func Load(h string) *pyjson.Object
- func LoadUnlocked(h string) *pyjson.Object
- func Lock(h string) (func(), error)
- func LockPath(h string) string
- func Mutate(h string, mutate func(subs *pyjson.Object) error) error
- func Path(h string) string
- func Replace(h, name string, route *pyjson.Object, expected any) (*pyjson.Object, error)
- func RouteURL(ctx context.Context, h, name string, route *pyjson.Object) string
- func SaveUnlocked(h string, subs *pyjson.Object) error
- func WebhookConfig(ctx context.Context, h string) map[string]any
- func WebhookEnabled(ctx context.Context, h string) bool
- type LockUnavailableError
- type SubscriptionMutationConflict
Constants ¶
This section is empty.
Variables ¶
var Missing any = missingSubscription{}
Sentinel expected value of Replace for a route that must not exist yet
Functions ¶
func ApplyPlain ¶
Writes a plain map mutation back into the ordered snapshot, surviving keys in file order and new keys sorted after
func BaseURL ¶
Local base URL of the webhook listener, wildcard hosts shown as localhost and IPv6 bracketed
func Load ¶
Lock free read, writers publish by atomic rename so a reader always sees one whole snapshot
func LoadUnlocked ¶
One complete store snapshot in file order, unreadable or malformed files reading as empty
func Mutate ¶
Locks, rereads, mutates and atomically publishes one snapshot, an error from mutate publishing nothing
func Replace ¶
Swaps one route only when it still equals expected, keeping an explicit enabled false, and returns it as published
func SaveUnlocked ¶
Publishes the snapshot atomically as two space indented JSON with owner only mode
func WebhookConfig ¶
The platforms.webhook config mapping with the WEBHOOK_ENABLED, WEBHOOK_PORT and WEBHOOK_SECRET layer the gateway applies
Types ¶
type LockUnavailableError ¶
type LockUnavailableError struct {
}
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 (e *SubscriptionMutationConflict) Error() string
func (*SubscriptionMutationConflict) PyTypeName ¶
func (e *SubscriptionMutationConflict) PyTypeName() string
Python exception class name the error stands for