api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 42 Imported by: 0 modules, 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

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.2 DO NOT EDIT.

Package api serves the REST API, SSE and MCP endpoints.

Index

Constants

View Source
const (
	// AuthReasonMissing: no Authorization header.
	AuthReasonMissing = "missing"
	// AuthReasonMalformed: a header that is not one "Bearer <token>", or a
	// token that fails the format's strict parse or checksum.
	AuthReasonMalformed = "malformed"
	// AuthReasonUnknown: no token has this id, or the hash does not match;
	// also any refusal whose error does not say why.
	AuthReasonUnknown = "unknown"
	// AuthReasonRevoked and AuthReasonExpired come only after the hash
	// matched, so they tell nothing to a caller without the token.
	AuthReasonRevoked = "revoked"
	AuthReasonExpired = "expired"
)

The reasons of a refused authentication (ADR 0030 T10, T11), a closed set: the label values of angelia_api_auth_failures_total and the auth_failure field of the access log. They never reach the caller, whose 401 is the same for every reason.

View Source
const (
	SlugBadRequest           = "bad-request"
	SlugUnauthorized         = "unauthorized"
	SlugForbidden            = "forbidden"
	SlugNotFound             = "not-found"
	SlugManagedByFile        = "managed-by-file"
	SlugCrossOwnerReference  = "cross-owner-reference"
	SlugSinkInUse            = "sink-in-use"
	SlugSecretInUse          = "secret-in-use"
	SlugSecretsKeyMissing    = "secrets-key-missing"
	SlugSecretHostBinding    = "secret-host-binding-required"
	SlugNotReplayable        = "not-replayable"
	SlugCursorExpired        = "cursor-expired"
	SlugPayloadTooLarge      = "payload-too-large"
	SlugUnsupportedMediaType = "unsupported-media-type"
	SlugEnvNotAllowed        = "env-not-allowed"
	SlugValidationFailed     = "validation-failed"
	SlugInternalError        = "internal-error"
	SlugUnavailable          = "unavailable"
)

Problem slugs (spec docs/api.md, "Problem types").

View Source
const (
	DefaultStreamPoll = time.Second
	DefaultKeepAlive  = 15 * time.Second
	MaxAuthRecheck    = 60 * time.Second
	DefaultEventScan  = 10000
	// DefaultMaxStreams bounds the event streams one Server holds open.
	DefaultMaxStreams = 1000
	// DefaultDrainWait is Options.DrainWait's default: the HTTP write
	// timeout of the supervisor, which already bounds every request but an
	// event stream (closed by the drain), so that the wait plus the final
	// flush stays inside the default drain timeout (25 s).
	DefaultDrainWait = 10 * time.Second

	// StatusClientClosed is the status the access log records for a request
	// whose client went away before anything was written (nginx's 499). It
	// is never sent.
	StatusClientClosed = 499
)

Stream defaults (spec docs/api.md decision 15).

View Source
const MCPPath = "/mcp"

MCPPath is where the api role serves MCP over Streamable HTTP (ADR 0029, D9): outside /v1/, since MCP versions itself through protocol negotiation.

View Source
const Masked = "[REDACTED]"

Masked is the value of a configuration key the kind marks secret.

View Source
const MaxBodyBytes = 1 << 20

MaxBodyBytes is the largest request body accepted (spec docs/api.md decision 21); larger bodies get 413 payload-too-large.

View Source
const ProblemTypeBase = "https://github.com/angelia-dev/spec/blob/main/docs/api.md#problem-"

ProblemTypeBase is the prefix of every problem type URI (spec docs/api.md decision 18); the slug follows it.

View Source
const RetryAfterSeconds = 5

RetryAfterSeconds is the Retry-After of a 503 while the instance drains.

Variables

View Source
var ErrUnauthenticated = errors.New("api: unauthenticated")

ErrUnauthenticated is returned (wrapped) by an Authenticator for a token it does not accept: unknown, revoked or malformed.

Functions

func AuthReasons added in v0.2.0

func AuthReasons() []string

AuthReasons lists the reasons, in a fixed order.

func CheckStoredSinks

func CheckStoredSinks(ctx context.Context, st store.APIStore, plugins []PluginInfo) error

CheckStoredSinks runs Server.CheckStoredSinks for a process that opens the store without serving the API: the scheduler and dispatcher roles run it before they start, as the api role does (ADR 0024 amendment). plugins is the catalogue the api role would serve (Options.Plugins).

The Server it builds has only spec, opts.Store and opts.Plugins set: the method, and configSchema below it, must use nothing else (no logger, no auth, no clock), or this function must set it too.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func SinkDestinations

func SinkDestinations(plugins []PluginInfo) (map[string]string, error)

SinkDestinations maps every sink kind in plugins to the JSON Pointer of the configuration key its config_schema marks x-angelia-destination: true (ADR 0024 §2), for dispatch.Options.Destinations. A built-in kind without a schema of its own uses the one the specification documents. A kind that marks no key is left out; one that marks several is an error.

func SinkSecretDestinations

func SinkSecretDestinations(plugins []PluginInfo) (map[string][]string, error)

SinkSecretDestinations maps every sink kind in plugins to the JSON Pointers of the reference keys its config_schema marks x-angelia-secret-destination: true (ADR 0026 §1), for dispatch.Options.SecretDestinations: the resolved value of such a key is the destination itself. A built-in kind without a schema of its own uses the one the specification documents (the shoutrrr kind's url_ref and url_env). A kind that marks no key is left out. Only *_ref and *_env keys can carry the annotation, since only they are resolved; another key is an error, as is a kind that also marks x-angelia-destination.

Types

type AckConsumerJSONRequestBody added in v0.2.0

type AckConsumerJSONRequestBody = ConsumerAck

AckConsumerJSONRequestBody defines body for AckConsumer for application/json ContentType.

type AckConsumerRequestObject added in v0.2.0

type AckConsumerRequestObject struct {
	Name ConsumerName `json:"name"`
	Body *AckConsumerJSONRequestBody
}

type AckConsumerResponseObject added in v0.2.0

type AckConsumerResponseObject interface {
	VisitAckConsumerResponse(w http.ResponseWriter) error
}

type After

type After = Seq

After An event's position in the log, assigned in commit order (`event.seq`). Strictly increasing; there may be gaps.

Examples: 4182

type AuthFailure added in v0.2.0

type AuthFailure interface {
	error
	// FailureReason returns one of the AuthReason values and, for
	// AuthReasonRevoked and AuthReasonExpired only, the token id.
	FailureReason() (reason, tokenID string)
}

AuthFailure is an authentication error that says why it failed. An Authenticator's error may implement it (internal/apitoken does); the server reads it with errors.As for the metric and the access log.

type AuthMetrics added in v0.2.0

type AuthMetrics interface {
	AuthFailed(reason string)
}

AuthMetrics counts refused authentications by reason (angelia_api_auth_failures_total). metrics.Metrics implements it.

type Authenticator

type Authenticator interface {
	// Authenticate returns the token's principal, or an error wrapping
	// ErrUnauthenticated. Any other error is a server failure (500).
	Authenticate(ctx context.Context, token string) (Principal, error)
}

Authenticator resolves a bearer token to its principal. internal/apitoken implements it over the stored API tokens (ADR 0030); an implementation compares secrets in constant time (crypto/subtle). The server calls it on every request and again at least every 60 seconds on an open event stream, so a revoked token stops working within that time.

type BadRequest

type BadRequest = Problem

BadRequest RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type BadRequestApplicationProblemPlusJSONResponse

type BadRequestApplicationProblemPlusJSONResponse Problem

type Bump

type Bump string

Bump defines model for Bump.

const (
	Major Bump = "major"
	Minor Bump = "minor"
	Patch Bump = "patch"
)

Defines values for Bump.

func (Bump) Valid

func (e Bump) Valid() bool

Valid indicates whether the value is a known member of the Bump enum.

type Change

type Change string

Change is the value of the Angelia-Change header (spec docs/api.md decision 6).

const (
	ChangeCreated   Change = "created"
	ChangeUpdated   Change = "updated"
	ChangeUnchanged Change = "unchanged"
	ChangeDeleted   Change = "deleted"
)

The changes a PUT or DELETE reports.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type Conflict

type Conflict = Problem

Conflict RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type ConflictApplicationProblemPlusJSONResponse

type ConflictApplicationProblemPlusJSONResponse Problem

type Consumer added in v0.2.0

type Consumer struct {
	// AckedAt When an ack last moved `acked_seq`, or `null` if none has.
	AckedAt *Timestamp `json:"acked_at"`

	// AckedSeq The cursor. Every event up to and including this `seq` is acknowledged; `?consumer=` reads the events after it. It only grows.
	//
	// Examples: 4182
	AckedSeq Seq `json:"acked_seq"`

	// CreatedAt RFC 3339 timestamp in UTC with a Z suffix and at most millisecond precision (the server always sends milliseconds).
	//
	// Examples: 2026-10-30T17:00:02.512Z
	CreatedAt Timestamp `json:"created_at"`

	// Filter The stored filter, every key present.
	Filter ConsumerFilter `json:"filter"`

	// Id Generated when the consumer is created; kept across updates.
	Id Ulid `json:"id"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// UpdatedAt When the filter was last changed by a `PUT`. An ack does not change it.
	//
	// Examples: 2026-10-30T17:00:02.512Z
	UpdatedAt Timestamp `json:"updated_at"`
}

Consumer A consumer as the server returns it, with its cursor.

type ConsumerAck added in v0.2.0

type ConsumerAck struct {
	// EventId An event's CloudEvents `id`; the server acknowledges up to that event's `seq`. The event must still be in the log.
	EventId *Ulid `json:"event_id,omitempty"`

	// Seq An event's `seq`, or a page's `next_after`. At most the highest `seq` ever committed (pruned events included), so `oldest_seq − 1` is accepted on a log whose every event was pruned.
	//
	// Examples: 4182
	Seq *Seq `json:"seq,omitempty"`
	// contains filtered or unexported fields
}

ConsumerAck The body of `POST /v1/consumers/{name}/ack`: exactly one of `seq` and `event_id`. Everything up to and including that position is acknowledged.

func (ConsumerAck) AsConsumerAck0 added in v0.2.0

func (t ConsumerAck) AsConsumerAck0() (ConsumerAck0, error)

AsConsumerAck0 returns the union data inside the ConsumerAck as a ConsumerAck0

func (ConsumerAck) AsConsumerAck1 added in v0.2.0

func (t ConsumerAck) AsConsumerAck1() (ConsumerAck1, error)

AsConsumerAck1 returns the union data inside the ConsumerAck as a ConsumerAck1

func (*ConsumerAck) FromConsumerAck0 added in v0.2.0

func (t *ConsumerAck) FromConsumerAck0(v ConsumerAck0) error

FromConsumerAck0 overwrites any union data inside the ConsumerAck as the provided ConsumerAck0

func (*ConsumerAck) FromConsumerAck1 added in v0.2.0

func (t *ConsumerAck) FromConsumerAck1(v ConsumerAck1) error

FromConsumerAck1 overwrites any union data inside the ConsumerAck as the provided ConsumerAck1

func (ConsumerAck) MarshalJSON added in v0.2.0

func (t ConsumerAck) MarshalJSON() ([]byte, error)

func (*ConsumerAck) MergeConsumerAck0 added in v0.2.0

func (t *ConsumerAck) MergeConsumerAck0(v ConsumerAck0) error

MergeConsumerAck0 performs a merge with any union data inside the ConsumerAck, using the provided ConsumerAck0

func (*ConsumerAck) MergeConsumerAck1 added in v0.2.0

func (t *ConsumerAck) MergeConsumerAck1(v ConsumerAck1) error

MergeConsumerAck1 performs a merge with any union data inside the ConsumerAck, using the provided ConsumerAck1

func (*ConsumerAck) UnmarshalJSON added in v0.2.0

func (t *ConsumerAck) UnmarshalJSON(b []byte) error

type ConsumerAck0 added in v0.2.0

type ConsumerAck0 = interface{}

ConsumerAck0 defines model for ConsumerAck.0.

type ConsumerAck1 added in v0.2.0

type ConsumerAck1 = interface{}

ConsumerAck1 defines model for ConsumerAck.1.

type ConsumerFilter added in v0.2.0

type ConsumerFilter struct {
	// Source Source kinds, matched against the event's `data.source` (always the base kind).
	Source *[]Kind `json:"source,omitempty"`

	// Type Short event types. Empty means every type.
	Type *[]ShortEventType `json:"type,omitempty"`

	// Watch Watches, each by name or by id. A name means the watch's current id; an id also matches events of a watch that was deleted or renamed.
	Watch *[]NameOrId `json:"watch,omitempty"`
}

ConsumerFilter Which events a consumer reads: the keys and values of the `GET /v1/events` filters. All given keys must match; an empty or absent key matches every event (so an empty `type` means all types, unlike `SubscriptionFilter`, whose default is `release.published`). Stored as written; watch names are resolved at each request, as the `watch` query parameter is, and once per stream when a stream starts.

type ConsumerName added in v0.2.0

type ConsumerName = Name

ConsumerName The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type ConsumerPage added in v0.2.0

type ConsumerPage struct {
	Items []Consumer `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

ConsumerPage defines model for ConsumerPage.

type ConsumerParam added in v0.2.0

type ConsumerParam = Name

ConsumerParam The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type ConsumerStart added in v0.2.0

type ConsumerStart string

ConsumerStart Where a new consumer's cursor starts. `latest`: at the highest `seq` ever committed (pruned events included) when the create commits, so it reads only events committed after its creation (an event committed concurrently may or may not be included). `earliest`: at the highest pruned `seq` (`0` on a log that was never pruned), so it reads from the oldest event kept.

const (
	Earliest ConsumerStart = "earliest"
	Latest   ConsumerStart = "latest"
)

Defines values for ConsumerStart.

func (ConsumerStart) Valid added in v0.2.0

func (e ConsumerStart) Valid() bool

Valid indicates whether the value is a known member of the ConsumerStart enum.

type ConsumerWrite added in v0.2.0

type ConsumerWrite struct {
	// Filter Which events a consumer reads: the keys and values of the `GET /v1/events` filters. All
	// given keys must match; an empty or absent key matches every event (so an empty `type`
	// means all types, unlike `SubscriptionFilter`, whose default is `release.published`).
	// Stored as written; watch names are resolved at each request, as the `watch` query
	// parameter is, and once per stream when a stream starts.
	Filter *ConsumerFilter `json:"filter,omitempty"`

	// Name Optional; when given it must equal the name in the path.
	Name *Name `json:"name,omitempty"`

	// Start Applies only when the consumer is created; ignored on an existing consumer, whose cursor a `PUT` never moves.
	Start *ConsumerStart `json:"start,omitempty"`
}

ConsumerWrite The body of `PUT /v1/consumers/{name}`. Omitted keys take their defaults.

type CreateReplayJSONRequestBody

type CreateReplayJSONRequestBody = ReplayRequest

CreateReplayJSONRequestBody defines body for CreateReplay for application/json ContentType.

type CreateReplayRequestObject

type CreateReplayRequestObject struct {
	Body *CreateReplayJSONRequestBody
}

type CreateReplayResponseObject

type CreateReplayResponseObject interface {
	VisitCreateReplayResponse(w http.ResponseWriter) error
}

type CreateTokenJSONRequestBody added in v0.2.0

type CreateTokenJSONRequestBody = TokenCreate

CreateTokenJSONRequestBody defines body for CreateToken for application/json ContentType.

type CreateTokenRequestObject added in v0.2.0

type CreateTokenRequestObject struct {
	Body *CreateTokenJSONRequestBody
}

type CreateTokenResponseObject added in v0.2.0

type CreateTokenResponseObject interface {
	VisitCreateTokenResponse(w http.ResponseWriter) error
}

type Cursor

type Cursor = string

Cursor An opaque page cursor. Clients pass it back unchanged and must not parse it.

Examples: eyJuIjoicmVxdWVzdHMifQ

type CursorExpired

type CursorExpired = Problem

CursorExpired RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type CursorExpiredApplicationProblemPlusJSONResponse

type CursorExpiredApplicationProblemPlusJSONResponse Problem

type DeleteConsumerParams added in v0.2.0

type DeleteConsumerParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

DeleteConsumerParams defines parameters for DeleteConsumer.

type DeleteConsumerRequestObject added in v0.2.0

type DeleteConsumerRequestObject struct {
	Name   ConsumerName `json:"name"`
	Params DeleteConsumerParams
}

type DeleteConsumerResponseObject added in v0.2.0

type DeleteConsumerResponseObject interface {
	VisitDeleteConsumerResponse(w http.ResponseWriter) error
}

type DeleteSecretParams

type DeleteSecretParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

DeleteSecretParams defines parameters for DeleteSecret.

type DeleteSecretRequestObject

type DeleteSecretRequestObject struct {
	Name   SecretName `json:"name"`
	Params DeleteSecretParams
}

type DeleteSecretResponseObject

type DeleteSecretResponseObject interface {
	VisitDeleteSecretResponse(w http.ResponseWriter) error
}

type DeleteSinkParams

type DeleteSinkParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

DeleteSinkParams defines parameters for DeleteSink.

type DeleteSinkRequestObject

type DeleteSinkRequestObject struct {
	Name   SinkName `json:"name"`
	Params DeleteSinkParams
}

type DeleteSinkResponseObject

type DeleteSinkResponseObject interface {
	VisitDeleteSinkResponse(w http.ResponseWriter) error
}

type DeleteSubscriptionParams

type DeleteSubscriptionParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

DeleteSubscriptionParams defines parameters for DeleteSubscription.

type DeleteSubscriptionRequestObject

type DeleteSubscriptionRequestObject struct {
	Name   SubscriptionName `json:"name"`
	Params DeleteSubscriptionParams
}

type DeleteSubscriptionResponseObject

type DeleteSubscriptionResponseObject interface {
	VisitDeleteSubscriptionResponse(w http.ResponseWriter) error
}

type DeleteWatchParams

type DeleteWatchParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

DeleteWatchParams defines parameters for DeleteWatch.

type DeleteWatchRequestObject

type DeleteWatchRequestObject struct {
	Name   WatchName `json:"name"`
	Params DeleteWatchParams
}

type DeleteWatchResponseObject

type DeleteWatchResponseObject interface {
	VisitDeleteWatchResponse(w http.ResponseWriter) error
}

type Delivery

type Delivery struct {
	// Attempts Attempts started so far, replays included; a replay does not reset it.
	Attempts int `json:"attempts"`

	// EventId The CloudEvents `id` of the event.
	EventId Ulid `json:"event_id"`

	// HeldUntil The end of a cooldown hold, when the delivery is held; `null` otherwise.
	HeldUntil *Timestamp `json:"held_until"`

	// Id ULID: 26 characters, Crockford base32, upper case.
	Id Ulid `json:"id"`

	// IdempotencyKey `<event id>:<subscription id>`; the same on every attempt and replay.
	IdempotencyKey string `json:"idempotency_key"`

	// LastError The last failure, with URLs cut down to scheme and host, at most 1 KiB; `null` when there was none.
	LastError *string `json:"last_error"`

	// NextAttemptAt When a `pending` delivery is next due; `null` otherwise.
	NextAttemptAt *Timestamp `json:"next_attempt_at"`

	// Status `pending`: queued or held, due at `next_attempt_at`. `in_flight`: being sent. `delivered`: the sink accepted it. `dead`: given up (the dead-letter state); replayable.
	Status DeliveryStatus `json:"status"`

	// SubscriptionId ULID: 26 characters, Crockford base32, upper case.
	SubscriptionId Ulid `json:"subscription_id"`

	// SubscriptionName The subscription's current name, or `null` once it was deleted.
	SubscriptionName *Name `json:"subscription_name"`
}

Delivery One event sent to one subscription, with its retry state.

type DeliveryId

type DeliveryId = Ulid

DeliveryId ULID: 26 characters, Crockford base32, upper case.

type DeliveryPage

type DeliveryPage struct {
	Items []Delivery `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

DeliveryPage defines model for DeliveryPage.

type DeliveryStatus

type DeliveryStatus string

DeliveryStatus `pending`: queued or held, due at `next_attempt_at`. `in_flight`: being sent. `delivered`: the sink accepted it. `dead`: given up (the dead-letter state); replayable.

const (
	DeliveryStatusDead      DeliveryStatus = "dead"
	DeliveryStatusDelivered DeliveryStatus = "delivered"
	DeliveryStatusInFlight  DeliveryStatus = "in_flight"
	DeliveryStatusPending   DeliveryStatus = "pending"
)

Defines values for DeliveryStatus.

func (DeliveryStatus) Valid

func (e DeliveryStatus) Valid() bool

Valid indicates whether the value is a known member of the DeliveryStatus enum.

type DenyAll

type DenyAll struct{}

DenyAll accepts no token, so every API request gets 401.

func (DenyAll) Authenticate

func (DenyAll) Authenticate(context.Context, string) (Principal, error)

Authenticate implements Authenticator.

type DryRun

type DryRun = bool

DryRun defines model for DryRun.

type Duration

type Duration = string

Duration A Go duration (`30m`, `6h`, `1h30m`, `0`). The range depends on the field; the server keeps whole seconds and cuts any fraction.

type EventLimit

type EventLimit = int

EventLimit defines model for EventLimit.

type EventPage

type EventPage struct {
	// HasMore Whether the scan stopped before the end of the log. A page can be empty with `has_more` true when the server's bounded scan found no matching event; ask again with `next_after`.
	HasMore bool          `json:"has_more"`
	Items   []EventRecord `json:"items"`

	// NextAfter The cursor for the next request, the highest `seq` the server scanned, which can be beyond the last item when the filters skipped events, or the request's `after` when nothing was scanned.
	//
	// Examples: 4182
	NextAfter Seq `json:"next_after"`
}

EventPage defines model for EventPage.

type EventRecord

type EventRecord struct {
	// Event Angelia's profile of a CloudEvents 1.0 event in JSON structured mode for the release event types dev.angelia.release.published.v1, dev.angelia.release.yanked.v1 and dev.angelia.release.prerelease.v1. The three types share one data schema (schemas/release/v1.json). DRAFT: while the spec repository is at version 0.x this profile may still change in a breaking way in any 0.x minor release; it is frozen at spec 1.0.0. v1 defines no extension attributes and producers emit none, but other producers or intermediaries (brokers, tracing) may add CloudEvents extension attributes: any attribute whose name is 1 to 20 lower-case letters or digits is allowed, and consumers must ignore attributes they do not know. Other unknown names are rejected.
	Event json.RawMessage `json:"event"`

	// RefEventId For a `release.yanked` event, the id of the event it yanks (the earlier `release.published` or `release.prerelease` of the same watch); `null` for other types.
	RefEventId *Ulid `json:"ref_event_id"`

	// Seq An event's position in the log, assigned in commit order (`event.seq`). Strictly increasing; there may be gaps.
	//
	// Examples: 4182
	Seq Seq `json:"seq"`
}

EventRecord One event of the log with its cursor position. `event` is the CloudEvents envelope exactly as it was emitted and delivered.

type Forbidden

type Forbidden = Problem

Forbidden RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type ForbiddenApplicationProblemPlusJSONResponse

type ForbiddenApplicationProblemPlusJSONResponse Problem

type GetConsumerRequestObject added in v0.2.0

type GetConsumerRequestObject struct {
	Name ConsumerName `json:"name"`
}

type GetConsumerResponseObject added in v0.2.0

type GetConsumerResponseObject interface {
	VisitGetConsumerResponse(w http.ResponseWriter) error
}

type GetDeliveryRequestObject

type GetDeliveryRequestObject struct {
	Id DeliveryId `json:"id"`
}

type GetDeliveryResponseObject

type GetDeliveryResponseObject interface {
	VisitGetDeliveryResponse(w http.ResponseWriter) error
}

type GetEventRequestObject

type GetEventRequestObject struct {
	Id Ulid `json:"id"`
}

type GetEventResponseObject

type GetEventResponseObject interface {
	VisitGetEventResponse(w http.ResponseWriter) error
}

type GetPluginRequestObject

type GetPluginRequestObject struct {
	Interface PluginInterface `json:"interface"`
	Kind      Kind            `json:"kind"`
}

type GetPluginResponseObject

type GetPluginResponseObject interface {
	VisitGetPluginResponse(w http.ResponseWriter) error
}

type GetSecretRequestObject

type GetSecretRequestObject struct {
	Name SecretName `json:"name"`
}

type GetSecretResponseObject

type GetSecretResponseObject interface {
	VisitGetSecretResponse(w http.ResponseWriter) error
}

type GetSinkRequestObject

type GetSinkRequestObject struct {
	Name SinkName `json:"name"`
}

type GetSinkResponseObject

type GetSinkResponseObject interface {
	VisitGetSinkResponse(w http.ResponseWriter) error
}

type GetSubscriptionRequestObject

type GetSubscriptionRequestObject struct {
	Name SubscriptionName `json:"name"`
}

type GetSubscriptionResponseObject

type GetSubscriptionResponseObject interface {
	VisitGetSubscriptionResponse(w http.ResponseWriter) error
}

type GetTokenRequestObject added in v0.2.0

type GetTokenRequestObject struct {
	Id TokenId `json:"id"`
}

type GetTokenResponseObject added in v0.2.0

type GetTokenResponseObject interface {
	VisitGetTokenResponse(w http.ResponseWriter) error
}

type GetWatchRequestObject

type GetWatchRequestObject struct {
	Name WatchName `json:"name"`
}

type GetWatchResponseObject

type GetWatchResponseObject interface {
	VisitGetWatchResponse(w http.ResponseWriter) error
}

type IncludeRevoked added in v0.2.0

type IncludeRevoked = bool

IncludeRevoked defines model for IncludeRevoked.

type InternalError

type InternalError = Problem

InternalError RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type InternalErrorApplicationProblemPlusJSONResponse

type InternalErrorApplicationProblemPlusJSONResponse Problem

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type Kind

type Kind = string

Kind A source or sink kind (`pypi`, `github-release`, `webhook`, a plugin's kind, ...).

type LabelFilter

type LabelFilter = []string

LabelFilter defines model for LabelFilter.

type Labels

type Labels map[string]string

Labels String labels. At most 32; keys `^[A-Za-z0-9]A-Za-z0-9._/-{0,62}$`, values at most 253 characters with no control characters.

Examples: {"team":"platform"}

type Limit

type Limit = int

Limit defines model for Limit.

type ListConsumersParams added in v0.2.0

type ListConsumersParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
}

ListConsumersParams defines parameters for ListConsumers.

type ListConsumersRequestObject added in v0.2.0

type ListConsumersRequestObject struct {
	Params ListConsumersParams
}

type ListConsumersResponseObject added in v0.2.0

type ListConsumersResponseObject interface {
	VisitListConsumersResponse(w http.ResponseWriter) error
}

type ListDeliveriesParams

type ListDeliveriesParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Status Only deliveries in these states.
	Status *[]DeliveryStatus `form:"status,omitempty" json:"status,omitempty"`

	// Subscription Only deliveries of this subscription, by name (current subscriptions) or by id (also deleted ones).
	Subscription *NameOrId `form:"subscription,omitempty" json:"subscription,omitempty"`

	// Event Only deliveries of this event, by event id.
	Event *Ulid `form:"event,omitempty" json:"event,omitempty"`
}

ListDeliveriesParams defines parameters for ListDeliveries.

type ListDeliveriesRequestObject

type ListDeliveriesRequestObject struct {
	Params ListDeliveriesParams
}

type ListDeliveriesResponseObject

type ListDeliveriesResponseObject interface {
	VisitListDeliveriesResponse(w http.ResponseWriter) error
}

type ListEventsParams

type ListEventsParams struct {
	// After Return the events whose `seq` is greater than this. `0` (the default) starts at the oldest event kept.
	After *After `form:"after,omitempty" json:"after,omitempty"`

	// Limit Page size.
	Limit *EventLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// Watch Only events of these watches, each given by name or by id. A name (always lower case)
	// means the watch's current id; an id (a ULID, always upper case) also matches events of a
	// watch that was deleted or renamed.
	Watch *WatchFilter `form:"watch,omitempty" json:"watch,omitempty"`

	// Type Only events of these short types (as in a subscription filter).
	Type *TypeFilter `form:"type,omitempty" json:"type,omitempty"`

	// Source Only watches (or events of watches) with these sources. On watches it matches the watch's `source` (a kind or a configured instance name); on events it matches `data.source`, which is always the base kind.
	Source *SourceFilter `form:"source,omitempty" json:"source,omitempty"`

	// Consumer Read through this consumer: start after its `acked_seq`, with its stored filter. Exclusive
	// with `after`, `watch`, `type` and `source` by presence: sending any of them with `consumer`,
	// even `after=0` or an empty value, gets `400`. Reading never moves
	// the consumer's cursor; `POST /v1/consumers/{name}/ack` does.
	Consumer *ConsumerParam `form:"consumer,omitempty" json:"consumer,omitempty"`
}

ListEventsParams defines parameters for ListEvents.

type ListEventsRequestObject

type ListEventsRequestObject struct {
	Params ListEventsParams
}

type ListEventsResponseObject

type ListEventsResponseObject interface {
	VisitListEventsResponse(w http.ResponseWriter) error
}

type ListPluginsParams

type ListPluginsParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Interface Only source kinds or only sink kinds.
	Interface *PluginInterface `form:"interface,omitempty" json:"interface,omitempty"`
}

ListPluginsParams defines parameters for ListPlugins.

type ListPluginsRequestObject

type ListPluginsRequestObject struct {
	Params ListPluginsParams
}

type ListPluginsResponseObject

type ListPluginsResponseObject interface {
	VisitListPluginsResponse(w http.ResponseWriter) error
}

type ListSecretsParams

type ListSecretsParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
}

ListSecretsParams defines parameters for ListSecrets.

type ListSecretsRequestObject

type ListSecretsRequestObject struct {
	Params ListSecretsParams
}

type ListSecretsResponseObject

type ListSecretsResponseObject interface {
	VisitListSecretsResponse(w http.ResponseWriter) error
}

type ListSinksParams

type ListSinksParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Kind Only sinks of these kinds.
	Kind *[]Kind `form:"kind,omitempty" json:"kind,omitempty"`
}

ListSinksParams defines parameters for ListSinks.

type ListSinksRequestObject

type ListSinksRequestObject struct {
	Params ListSinksParams
}

type ListSinksResponseObject

type ListSinksResponseObject interface {
	VisitListSinksResponse(w http.ResponseWriter) error
}

type ListSubscriptionsParams

type ListSubscriptionsParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Sink Only subscriptions that deliver to this sink (by name).
	Sink *Name `form:"sink,omitempty" json:"sink,omitempty"`
}

ListSubscriptionsParams defines parameters for ListSubscriptions.

type ListSubscriptionsRequestObject

type ListSubscriptionsRequestObject struct {
	Params ListSubscriptionsParams
}

type ListSubscriptionsResponseObject

type ListSubscriptionsResponseObject interface {
	VisitListSubscriptionsResponse(w http.ResponseWriter) error
}

type ListTokensParams added in v0.2.0

type ListTokensParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// IncludeRevoked List revoked tokens too. Expired tokens are always listed.
	IncludeRevoked *IncludeRevoked `form:"include_revoked,omitempty" json:"include_revoked,omitempty"`
}

ListTokensParams defines parameters for ListTokens.

type ListTokensRequestObject added in v0.2.0

type ListTokensRequestObject struct {
	Params ListTokensParams
}

type ListTokensResponseObject added in v0.2.0

type ListTokensResponseObject interface {
	VisitListTokensResponse(w http.ResponseWriter) error
}

type ListWatchVersionsParams

type ListWatchVersionsParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Prerelease Only pre-releases (`true`) or only final releases (`false`). Absent means both.
	Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"`

	// Yanked Only yanked versions (`true`) or only versions that are not yanked (`false`). Absent means both.
	Yanked *bool `form:"yanked,omitempty" json:"yanked,omitempty"`
}

ListWatchVersionsParams defines parameters for ListWatchVersions.

type ListWatchVersionsRequestObject

type ListWatchVersionsRequestObject struct {
	Name   WatchName `json:"name"`
	Params ListWatchVersionsParams
}

type ListWatchVersionsResponseObject

type ListWatchVersionsResponseObject interface {
	VisitListWatchVersionsResponse(w http.ResponseWriter) error
}

type ListWatchesParams

type ListWatchesParams struct {
	// Limit Page size.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// Cursor The opaque `next_cursor` of the previous page. Absent for the first page.
	Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Source Only watches (or events of watches) with these sources. On watches it matches the watch's `source` (a kind or a configured instance name); on events it matches `data.source`, which is always the base kind.
	Source *SourceFilter `form:"source,omitempty" json:"source,omitempty"`

	// Label Only watches that carry this label with this value, as `key=value`. Repeat to require several.
	Label *LabelFilter `form:"label,omitempty" json:"label,omitempty"`
}

ListWatchesParams defines parameters for ListWatches.

type ListWatchesRequestObject

type ListWatchesRequestObject struct {
	Params ListWatchesParams
}

type ListWatchesResponseObject

type ListWatchesResponseObject interface {
	VisitListWatchesResponse(w http.ResponseWriter) error
}

type MCPFactory added in v0.2.0

type MCPFactory func(rest http.RoundTripper) (http.Handler, error)

MCPFactory builds the handler of MCPPath. rest is an in-memory transport into the Server's REST API: every request it carries goes through ServeHTTP, so authentication, scopes, validation and the access log are the REST API's. internal/mcp.NewHTTPHandler is the implementation; the api package does not import the MCP SDK.

type ManagedBy

type ManagedBy string

ManagedBy Who owns the resource. `api`: created through this API (or `angelia apply`). `file`: created from a watch file loaded with `angelia serve --watches`; the API reads it but refuses to change or delete it (`409 managed-by-file`).

const (
	Api  ManagedBy = "api"
	File ManagedBy = "file"
)

Defines values for ManagedBy.

func (ManagedBy) Valid

func (e ManagedBy) Valid() bool

Valid indicates whether the value is a known member of the ManagedBy enum.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type Name

type Name = string

Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type NameOrId

type NameOrId = string

NameOrId A name (lower case) or a ULID id (upper case). The two never overlap.

type NextCursor

type NextCursor = Cursor

NextCursor The cursor of the next page, or `null` on the last page.

type NotFound

type NotFound = Problem

NotFound RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type NotFoundApplicationProblemPlusJSONResponse

type NotFoundApplicationProblemPlusJSONResponse Problem

type Options

type Options struct {
	Store store.APIStore
	// Auth resolves bearer tokens; `angelia serve` passes the API token
	// authenticator of internal/apitoken (ADR 0030).
	Auth Authenticator
	// AuthLoop, if set, is the authenticator's background work (the
	// last-use flush of internal/apitoken): the api role runs it for its
	// lifetime and, once it drains, cancels its context and waits for it to
	// return, so that it can write what it holds. An error ends the role.
	AuthLoop func(ctx context.Context) error
	// Sources validates watch coordinates (no I/O), as for the watch file.
	Sources *source.Registry
	// Plugins is the catalogue of GET /v1/plugins: every usable source and
	// sink kind, built-in or installed.
	Plugins []PluginInfo
	// API is the instance configuration's api section (api.allowed_env).
	API config.API
	// Secrets seals the values of /v1/secrets; nil means no key is
	// configured, and a write gets 422 secrets-key-missing.
	Secrets *secrets.Keyring
	// AllowHTTPHosts is http.allow_http_hosts: the hosts a webhook may
	// reach over plain http:// (decision D12). Empty: https only.
	AllowHTTPHosts []string
	// Logger receives the access log and the audit records; nil discards.
	Logger *slog.Logger
	// Now and NewID default to the real clock and random ULIDs.
	Now   func() time.Time
	NewID func() string

	// StreamPoll is how often an open event stream looks for new events;
	// KeepAlive how long it stays silent before a keep-alive comment;
	// AuthRecheck how often it checks its token again (at most 60 s).
	StreamPoll  time.Duration
	KeepAlive   time.Duration
	AuthRecheck time.Duration
	// EventScan bounds the events one GET /v1/events request reads.
	EventScan int
	// MaxStreams bounds the open event streams: the next one gets 503
	// unavailable with Retry-After. 0 means DefaultMaxStreams.
	MaxStreams int
	// Metrics, if set, observes the open event streams
	// (angelia_api_event_streams) and, when it also implements AuthMetrics,
	// the refused authentications (angelia_api_auth_failures_total). Pass a
	// non-nil value or leave it nil.
	Metrics StreamMetrics
	// DrainWait bounds how long the api role, once it drains, waits for the
	// requests still in flight to finish before it stops AuthLoop (whose
	// last flush must come after their authentications). 0 means
	// DefaultDrainWait.
	DrainWait time.Duration
	// MCP, if set, builds the handler of POST /mcp (MCPPath), which the api
	// role then mounts next to /v1/. Nil: /mcp is not served.
	MCP MCPFactory
}

Options configures a Server. Store, Auth and Sources are required.

type PayloadTooLarge

type PayloadTooLarge = Problem

PayloadTooLarge RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type PayloadTooLargeApplicationProblemPlusJSONResponse

type PayloadTooLargeApplicationProblemPlusJSONResponse Problem

type Plugin

type Plugin struct {
	// Abi For a third-party plugin, the host ABI it was built against (for WASM, the import module name); `null` for built-ins.
	//
	// Examples: angelia:host/v0
	Abi *string `json:"abi"`

	// AllowedHosts For a third-party plugin, the hosts it may reach (manifest and operator entries merged); empty for built-ins, which use the instance's network rules.
	AllowedHosts []PluginHost `json:"allowed_hosts"`

	// ConfigSchema The JSON Schema of the kind's configuration (a watch's `coordinates` for a source, a sink's `config` for a sink), or `null` when the kind does not publish one. A property with `x-angelia-secret` true holds a secret value; the server masks it in every response and refuses it in API writes.
	ConfigSchema *map[string]interface{} `json:"config_schema"`

	// Interface Which core interface the plugin implements.
	Interface PluginInterface `json:"interface"`

	// Kind A source or sink kind (`pypi`, `github-release`, `webhook`, a plugin's kind, ...).
	Kind Kind `json:"kind"`

	// Runtime `builtin`: compiled into the binary. `wasm`: a WASM plugin. Open set: later runtimes may be added.
	//
	// Examples: wasm
	Runtime string `json:"runtime"`

	// Version The plugin's version from its manifest; for a built-in, the Angelia version. `null` when unknown.
	//
	// Examples: 0.3.1
	Version *string `json:"version"`
}

Plugin A source or sink kind the instance can use.

type PluginHost

type PluginHost struct {
	// CredentialPorts The ports on which the host injects a credential configured for this host. Never the credential itself.
	CredentialPorts []int `json:"credential_ports"`

	// Host Lower-case hostname or IP literal.
	//
	// Examples: crates-mirror.example.com
	Host string `json:"host"`

	// Origin `manifest`: declared by the plugin. `operator`: added in the instance configuration.
	Origin PluginHostOrigin `json:"origin"`
}

PluginHost defines model for PluginHost.

type PluginHostInfo

type PluginHostInfo struct {
	Host            string
	Origin          string // "manifest" or "operator"
	CredentialPorts []int
}

PluginHostInfo is one allowed host of a plugin.

type PluginHostOrigin

type PluginHostOrigin string

PluginHostOrigin `manifest`: declared by the plugin. `operator`: added in the instance configuration.

const (
	Manifest PluginHostOrigin = "manifest"
	Operator PluginHostOrigin = "operator"
)

Defines values for PluginHostOrigin.

func (PluginHostOrigin) Valid

func (e PluginHostOrigin) Valid() bool

Valid indicates whether the value is a known member of the PluginHostOrigin enum.

type PluginInfo

type PluginInfo struct {
	Kind      string
	Interface string // "source" or "sink"
	Runtime   string // "builtin", "wasm", ...
	// Version is the plugin's version, or the Angelia version for a
	// built-in; "" is unknown.
	Version string
	// ABI is the host ABI of a third-party plugin; "" for built-ins.
	ABI string
	// ConfigSchema is the JSON Schema of the kind's configuration, or nil.
	ConfigSchema json.RawMessage
	// AllowedHosts are the hosts a third-party plugin may reach.
	AllowedHosts []PluginHostInfo
}

PluginInfo is one entry of the plugin catalogue: a source or sink kind the instance can use (spec docs/api.md decision 29).

type PluginInterface

type PluginInterface string

PluginInterface Which core interface the plugin implements.

const (
	PluginInterfaceSink   PluginInterface = "sink"
	PluginInterfaceSource PluginInterface = "source"
)

Defines values for PluginInterface.

func (PluginInterface) Valid

func (e PluginInterface) Valid() bool

Valid indicates whether the value is a known member of the PluginInterface enum.

type PluginPage

type PluginPage struct {
	Items []Plugin `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

PluginPage defines model for PluginPage.

type PrereleaseMode

type PrereleaseMode string

PrereleaseMode `none`: drop pre-releases. `only`: keep only pre-releases. `include`: keep both.

const (
	Include PrereleaseMode = "include"
	None    PrereleaseMode = "none"
	Only    PrereleaseMode = "only"
)

Defines values for PrereleaseMode.

func (PrereleaseMode) Valid

func (e PrereleaseMode) Valid() bool

Valid indicates whether the value is a known member of the PrereleaseMode enum.

type Principal

type Principal struct {
	// ID names the token in logs and the audit trail. It must not be the
	// token or derived from it in a reversible way.
	ID string
	// Name is the token's operator label (ADR 0030 T9), for the access log
	// and the audit trail; it may be empty.
	Name  string
	Scope Scope
}

Principal is who a token belongs to.

type Problem

type Problem struct {
	// Detail Human-readable explanation of this occurrence. Never contains secrets.
	Detail *string `json:"detail,omitempty"`

	// Errors For `validation-failed`, every error found (the request is validated as a whole).
	Errors *[]ProblemError `json:"errors,omitempty"`

	// Instance The request path.
	Instance *string `json:"instance,omitempty"`

	// OldestSeq For `cursor-expired`, the `seq` of the oldest event kept; resume with `after` set just below it, accepting the gap.
	//
	// Examples: 4182
	OldestSeq *Seq `json:"oldest_seq,omitempty"`

	// RequiredScope For `forbidden`, the scope the operation needs.
	RequiredScope *ProblemRequiredScope `json:"required_scope,omitempty"`

	// Status The HTTP status code.
	Status int `json:"status"`

	// Title Short, human-readable summary of the problem type; the same for every occurrence.
	Title string `json:"title"`

	// Type Identifies the problem type; `https://github.com/angelia-dev/spec/blob/main/docs/api.md#problem-<slug>`.
	//
	// Examples: https://github.com/angelia-dev/spec/blob/main/docs/api.md#problem-validation-failed
	Type string `json:"type"`
}

Problem RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type ProblemDetail

type ProblemDetail struct {
	Type          string               `json:"type"`
	Title         string               `json:"title"`
	Status        int                  `json:"status"`
	Detail        string               `json:"detail,omitempty"`
	Instance      string               `json:"instance,omitempty"`
	Errors        []ProblemDetailError `json:"errors,omitempty"`
	RequiredScope string               `json:"required_scope,omitempty"`
	OldestSeq     *int64               `json:"oldest_seq,omitempty"`
	// contains filtered or unexported fields
}

ProblemDetail is an RFC 9457 problem detail. It is also the error the handlers return: the strict server's error handler writes it as the response. Detail must never hold a secret or a full sink URL.

func (*ProblemDetail) Error

func (p *ProblemDetail) Error() string

type ProblemDetailError

type ProblemDetailError struct {
	Pointer string `json:"pointer"`
	Detail  string `json:"detail"`
}

ProblemDetailError is one entry of Problem.Errors.

type ProblemError

type ProblemError struct {
	// Detail What is wrong with it.
	Detail string `json:"detail"`

	// Pointer JSON Pointer (RFC 6901) to the offending member of the request body; `""` for the whole body.
	//
	// Examples: /policy/prerelease
	Pointer string `json:"pointer"`
}

ProblemError defines model for ProblemError.

type ProblemRequiredScope

type ProblemRequiredScope string

ProblemRequiredScope For `forbidden`, the scope the operation needs.

const (
	ProblemRequiredScopeAdmin ProblemRequiredScope = "admin"
	ProblemRequiredScopeRead  ProblemRequiredScope = "read"
	ProblemRequiredScopeWrite ProblemRequiredScope = "write"
)

Defines values for ProblemRequiredScope.

func (ProblemRequiredScope) Valid

func (e ProblemRequiredScope) Valid() bool

Valid indicates whether the value is a known member of the ProblemRequiredScope enum.

type PutConsumerJSONRequestBody added in v0.2.0

type PutConsumerJSONRequestBody = ConsumerWrite

PutConsumerJSONRequestBody defines body for PutConsumer for application/json ContentType.

type PutConsumerParams added in v0.2.0

type PutConsumerParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

PutConsumerParams defines parameters for PutConsumer.

type PutConsumerRequestObject added in v0.2.0

type PutConsumerRequestObject struct {
	Name   ConsumerName `json:"name"`
	Params PutConsumerParams
	Body   *PutConsumerJSONRequestBody
}

type PutConsumerResponseObject added in v0.2.0

type PutConsumerResponseObject interface {
	VisitPutConsumerResponse(w http.ResponseWriter) error
}

type PutSecretJSONRequestBody

type PutSecretJSONRequestBody = SecretWrite

PutSecretJSONRequestBody defines body for PutSecret for application/json ContentType.

type PutSecretParams

type PutSecretParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

PutSecretParams defines parameters for PutSecret.

type PutSecretRequestObject

type PutSecretRequestObject struct {
	Name   SecretName `json:"name"`
	Params PutSecretParams
	Body   *PutSecretJSONRequestBody
}

type PutSecretResponseObject

type PutSecretResponseObject interface {
	VisitPutSecretResponse(w http.ResponseWriter) error
}

type PutSinkJSONRequestBody

type PutSinkJSONRequestBody = SinkWrite

PutSinkJSONRequestBody defines body for PutSink for application/json ContentType.

type PutSinkParams

type PutSinkParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

PutSinkParams defines parameters for PutSink.

type PutSinkRequestObject

type PutSinkRequestObject struct {
	Name   SinkName `json:"name"`
	Params PutSinkParams
	Body   *PutSinkJSONRequestBody
}

type PutSinkResponseObject

type PutSinkResponseObject interface {
	VisitPutSinkResponse(w http.ResponseWriter) error
}

type PutSubscriptionJSONRequestBody

type PutSubscriptionJSONRequestBody = SubscriptionWrite

PutSubscriptionJSONRequestBody defines body for PutSubscription for application/json ContentType.

type PutSubscriptionParams

type PutSubscriptionParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

PutSubscriptionParams defines parameters for PutSubscription.

type PutSubscriptionRequestObject

type PutSubscriptionRequestObject struct {
	Name   SubscriptionName `json:"name"`
	Params PutSubscriptionParams
	Body   *PutSubscriptionJSONRequestBody
}

type PutSubscriptionResponseObject

type PutSubscriptionResponseObject interface {
	VisitPutSubscriptionResponse(w http.ResponseWriter) error
}

type PutWatchJSONRequestBody

type PutWatchJSONRequestBody = WatchWrite

PutWatchJSONRequestBody defines body for PutWatch for application/json ContentType.

type PutWatchParams

type PutWatchParams struct {
	// DryRun Validate and compute the result, without writing anything. The response is the one the request would get.
	DryRun *DryRun `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

PutWatchParams defines parameters for PutWatch.

type PutWatchRequestObject

type PutWatchRequestObject struct {
	Name   WatchName `json:"name"`
	Params PutWatchParams
	Body   *PutWatchJSONRequestBody
}

type PutWatchResponseObject

type PutWatchResponseObject interface {
	VisitPutWatchResponse(w http.ResponseWriter) error
}

type ReplayDeliveryJSONBody

type ReplayDeliveryJSONBody = map[string]interface{}

ReplayDeliveryJSONBody defines parameters for ReplayDelivery.

type ReplayDeliveryJSONRequestBody

type ReplayDeliveryJSONRequestBody = ReplayDeliveryJSONBody

ReplayDeliveryJSONRequestBody defines body for ReplayDelivery for application/json ContentType.

type ReplayDeliveryRequestObject

type ReplayDeliveryRequestObject struct {
	Id   DeliveryId `json:"id"`
	Body *ReplayDeliveryJSONRequestBody
}

type ReplayDeliveryResponseObject

type ReplayDeliveryResponseObject interface {
	VisitReplayDeliveryResponse(w http.ResponseWriter) error
}

type ReplayRequest

type ReplayRequest struct {
	// DryRun Compute what would be replayed without queuing anything.
	DryRun *bool `json:"dry_run,omitempty"`

	// Event The deliveries of this event.
	Event *Ulid `json:"event,omitempty"`

	// Since Inclusive lower bound on the event `time`. Requires `subscription` and `until`.
	//
	// Examples: 2026-10-30T17:00:02.512Z
	Since *Timestamp `json:"since,omitempty"`

	// Status Replay only deliveries in these states.
	Status *[]ReplayRequestStatus `json:"status,omitempty"`

	// Subscription The deliveries of this subscription, by name or id.
	Subscription *NameOrId `json:"subscription,omitempty"`

	// Until Exclusive upper bound on the event `time`. Requires `subscription` and `since`.
	//
	// Examples: 2026-10-30T17:00:02.512Z
	Until *Timestamp `json:"until,omitempty"`
	// contains filtered or unexported fields
}

ReplayRequest Which deliveries to queue again: give `event`, or `subscription` with `since` and `until` (both may also be combined with `event`).

func (ReplayRequest) AsReplayRequest0

func (t ReplayRequest) AsReplayRequest0() (ReplayRequest0, error)

AsReplayRequest0 returns the union data inside the ReplayRequest as a ReplayRequest0

func (ReplayRequest) AsReplayRequest1

func (t ReplayRequest) AsReplayRequest1() (ReplayRequest1, error)

AsReplayRequest1 returns the union data inside the ReplayRequest as a ReplayRequest1

func (*ReplayRequest) FromReplayRequest0

func (t *ReplayRequest) FromReplayRequest0(v ReplayRequest0) error

FromReplayRequest0 overwrites any union data inside the ReplayRequest as the provided ReplayRequest0

func (*ReplayRequest) FromReplayRequest1

func (t *ReplayRequest) FromReplayRequest1(v ReplayRequest1) error

FromReplayRequest1 overwrites any union data inside the ReplayRequest as the provided ReplayRequest1

func (ReplayRequest) MarshalJSON

func (t ReplayRequest) MarshalJSON() ([]byte, error)

func (*ReplayRequest) MergeReplayRequest0

func (t *ReplayRequest) MergeReplayRequest0(v ReplayRequest0) error

MergeReplayRequest0 performs a merge with any union data inside the ReplayRequest, using the provided ReplayRequest0

func (*ReplayRequest) MergeReplayRequest1

func (t *ReplayRequest) MergeReplayRequest1(v ReplayRequest1) error

MergeReplayRequest1 performs a merge with any union data inside the ReplayRequest, using the provided ReplayRequest1

func (*ReplayRequest) UnmarshalJSON

func (t *ReplayRequest) UnmarshalJSON(b []byte) error

type ReplayRequest0

type ReplayRequest0 = interface{}

ReplayRequest0 defines model for ReplayRequest.0.

type ReplayRequest1

type ReplayRequest1 = interface{}

ReplayRequest1 defines model for ReplayRequest.1.

type ReplayRequestStatus

type ReplayRequestStatus string

ReplayRequestStatus defines model for ReplayRequest.Status.

const (
	ReplayRequestStatusDead      ReplayRequestStatus = "dead"
	ReplayRequestStatusDelivered ReplayRequestStatus = "delivered"
)

Defines values for ReplayRequestStatus.

func (ReplayRequestStatus) Valid

func (e ReplayRequestStatus) Valid() bool

Valid indicates whether the value is a known member of the ReplayRequestStatus enum.

type ReplayResult

type ReplayResult struct {
	// Deliveries The first 100 of them, oldest event first, as they are after the replay.
	Deliveries []Delivery `json:"deliveries"`
	DryRun     bool       `json:"dry_run"`

	// Replayed How many deliveries were queued again (or would be).
	Replayed int `json:"replayed"`

	// Truncated Whether `deliveries` lists fewer than `replayed`.
	Truncated bool `json:"truncated"`
}

ReplayResult defines model for ReplayResult.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type RevokeTokenRequestObject added in v0.2.0

type RevokeTokenRequestObject struct {
	Id TokenId `json:"id"`
}

type RevokeTokenResponseObject added in v0.2.0

type RevokeTokenResponseObject interface {
	VisitRevokeTokenResponse(w http.ResponseWriter) error
}

type Scope

type Scope int

Scope is the scope of an API token. Scopes are ordered: a token may call every operation whose scope is at or below its own (spec docs/api.md decision 22).

const (
	ScopeNone Scope = iota
	ScopeRead
	ScopeWrite
	ScopeAdmin
)

The scopes, in order. ScopeNone is no scope at all.

func ParseScope

func ParseScope(s string) (Scope, bool)

ParseScope reads "read", "write" or "admin".

func (Scope) String

func (s Scope) String() string

type Secret

type Secret struct {
	// CreatedAt RFC 3339 timestamp in UTC with a Z suffix and at most millisecond precision (the server always sends milliseconds).
	//
	// Examples: 2026-10-30T17:00:02.512Z
	CreatedAt Timestamp `json:"created_at"`

	// Hosts The host binding, as written; empty when the secret is unbound.
	Hosts []string `json:"hosts"`

	// KeyId The id of the key that encrypted the value (16 hex digits); it changes when `angelia secrets rotate` re-encrypts the value under a new key.
	KeyId string `json:"key_id"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// ReferencedBy The configuration that references the secret with a `*_ref` key, sorted by resource, name and pointer.
	ReferencedBy []SecretReferrer `json:"referenced_by"`

	// UpdatedAt When the value or the hosts were last written.
	//
	// Examples: 2026-10-30T17:00:02.512Z
	UpdatedAt Timestamp `json:"updated_at"`
}

Secret A stored secret as the server returns it: metadata only. No scope, flag or parameter returns its value.

type SecretName

type SecretName = Name

SecretName The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type SecretPage

type SecretPage struct {
	Items []Secret `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

SecretPage defines model for SecretPage.

type SecretReferrer

type SecretReferrer struct {
	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// Pointer JSON Pointer (RFC 6901) to the `*_ref` key in the resource.
	//
	// Examples: /config/secret_ref
	Pointer string `json:"pointer"`

	// Resource The kind of resource that holds the reference.
	Resource SecretReferrerResource `json:"resource"`
}

SecretReferrer defines model for SecretReferrer.

type SecretReferrerResource

type SecretReferrerResource string

SecretReferrerResource The kind of resource that holds the reference.

const (
	SecretReferrerResourceSink         SecretReferrerResource = "sink"
	SecretReferrerResourceSubscription SecretReferrerResource = "subscription"
	SecretReferrerResourceWatch        SecretReferrerResource = "watch"
)

Defines values for SecretReferrerResource.

func (SecretReferrerResource) Valid

func (e SecretReferrerResource) Valid() bool

Valid indicates whether the value is a known member of the SecretReferrerResource enum.

type SecretWrite

type SecretWrite struct {
	// Hosts The hosts the secret may be sent to (the host binding). Each entry is `host` (port
	// 443) or `host:port`: a lower-case hostname (IDNA as punycode, no trailing dot) or an IP
	// literal (`[addr]:port` for IPv6 with a port); no wildcards. A bound secret is resolved
	// only for a destination whose host and port equal an entry, and every request that
	// carries it is checked again, including each redirect hop. Empty or absent: unbound,
	// and only the `admin` scope needed to reference it guards where it goes. A secret
	// referenced from a source or registry credential must be bound
	// (`422 secret-host-binding-required`). Sinks follow no redirect, so for a sink the
	// check is made against the URL its kind marks `x-angelia-destination`, at every
	// delivery. Source and registry credentials cannot reference stored secrets yet (core
	// #111); the mandatory binding and the redirect re-check apply to them from then.
	Hosts *[]string `json:"hosts,omitempty"`

	// Name Optional; when given it must equal the name in the path.
	Name *Name `json:"name,omitempty"`

	// Value The secret as text, stored as its UTF-8 bytes exactly (nothing is trimmed). 1 byte to 64 KiB.
	Value *string `json:"value,omitempty"`

	// ValueBase64 The secret as the standard base64 encoding of its bytes (RFC 4648 section 4, padded). 1 byte to 64 KiB once decoded.
	ValueBase64 *string `json:"value_base64,omitempty"`
	// contains filtered or unexported fields
}

SecretWrite The body of `PUT /v1/secrets/{name}`: exactly one of `value` (text) and `value_base64` (any bytes), at most 64 KiB once decoded, and optional `hosts`. Both value members are write-only: no response, log, audit record or problem detail ever carries them.

func (SecretWrite) AsSecretWrite0

func (t SecretWrite) AsSecretWrite0() (SecretWrite0, error)

AsSecretWrite0 returns the union data inside the SecretWrite as a SecretWrite0

func (SecretWrite) AsSecretWrite1

func (t SecretWrite) AsSecretWrite1() (SecretWrite1, error)

AsSecretWrite1 returns the union data inside the SecretWrite as a SecretWrite1

func (*SecretWrite) FromSecretWrite0

func (t *SecretWrite) FromSecretWrite0(v SecretWrite0) error

FromSecretWrite0 overwrites any union data inside the SecretWrite as the provided SecretWrite0

func (*SecretWrite) FromSecretWrite1

func (t *SecretWrite) FromSecretWrite1(v SecretWrite1) error

FromSecretWrite1 overwrites any union data inside the SecretWrite as the provided SecretWrite1

func (SecretWrite) MarshalJSON

func (t SecretWrite) MarshalJSON() ([]byte, error)

func (*SecretWrite) MergeSecretWrite0

func (t *SecretWrite) MergeSecretWrite0(v SecretWrite0) error

MergeSecretWrite0 performs a merge with any union data inside the SecretWrite, using the provided SecretWrite0

func (*SecretWrite) MergeSecretWrite1

func (t *SecretWrite) MergeSecretWrite1(v SecretWrite1) error

MergeSecretWrite1 performs a merge with any union data inside the SecretWrite, using the provided SecretWrite1

func (*SecretWrite) UnmarshalJSON

func (t *SecretWrite) UnmarshalJSON(b []byte) error

type SecretWrite0

type SecretWrite0 = interface{}

SecretWrite0 defines model for SecretWrite.0.

type SecretWrite1

type SecretWrite1 = interface{}

SecretWrite1 defines model for SecretWrite.1.

type Seq

type Seq = int64

Seq An event's position in the log, assigned in commit order (`event.seq`). Strictly increasing; there may be gaps.

Examples: 4182

type Server

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

Server serves the REST API of spec openapi/angelia.v1.yaml. It is an http.Handler for the /v1/ paths, and for MCPPath when Options.MCP is set.

func New

func New(opts Options) (*Server, error)

New builds a Server.

func (*Server) AckConsumer added in v0.2.0

AckConsumer implements StrictServerInterface: a monotonic cursor commit. It is not audited (frequent); the access log records it.

func (*Server) CheckStoredSinks

func (s *Server) CheckStoredSinks(ctx context.Context) error

CheckStoredSinks is the fail-closed upgrade check of ADR 0024 §6: it refuses a stored sink whose configuration holds a literal value at a path its kind's config_schema marks x-angelia-secret, which only *_ref keys may carry now. The error names the sink and the pointer, never the value.

func (*Server) CreateReplay

CreateReplay implements StrictServerInterface.

func (*Server) CreateToken added in v0.2.0

CreateToken implements StrictServerInterface. The new token's creator is the caller's token id.

func (*Server) DeleteConsumer added in v0.2.0

DeleteConsumer implements StrictServerInterface.

func (*Server) DeleteSecret

DeleteSecret implements StrictServerInterface.

func (*Server) DeleteSink

DeleteSink implements StrictServerInterface.

func (*Server) DeleteSubscription

DeleteSubscription implements StrictServerInterface.

func (*Server) DeleteWatch

DeleteWatch implements StrictServerInterface.

func (*Server) Drain

func (s *Server) Drain()

Drain makes every new request get 503 unavailable with Retry-After and closes the open event streams. It is called once shutdown starts.

func (*Server) GetConsumer added in v0.2.0

GetConsumer implements StrictServerInterface.

func (*Server) GetDelivery

GetDelivery implements StrictServerInterface.

func (*Server) GetEvent

GetEvent implements StrictServerInterface.

func (*Server) GetPlugin

GetPlugin implements StrictServerInterface.

func (*Server) GetSecret

GetSecret implements StrictServerInterface.

func (*Server) GetSink

GetSink implements StrictServerInterface.

func (*Server) GetSubscription

GetSubscription implements StrictServerInterface.

func (*Server) GetToken added in v0.2.0

GetToken implements StrictServerInterface.

func (*Server) GetWatch

GetWatch implements StrictServerInterface.

func (*Server) ListConsumers added in v0.2.0

ListConsumers implements StrictServerInterface.

func (*Server) ListDeliveries

ListDeliveries implements StrictServerInterface.

func (*Server) ListEvents

ListEvents implements StrictServerInterface.

func (*Server) ListPlugins

ListPlugins implements StrictServerInterface.

func (*Server) ListSecrets

ListSecrets implements StrictServerInterface.

func (*Server) ListSinks

ListSinks implements StrictServerInterface.

func (*Server) ListSubscriptions

ListSubscriptions implements StrictServerInterface.

func (*Server) ListTokens added in v0.2.0

ListTokens implements StrictServerInterface.

func (*Server) ListWatchVersions

ListWatchVersions implements StrictServerInterface.

func (*Server) ListWatches

ListWatches implements StrictServerInterface.

func (*Server) PutConsumer added in v0.2.0

PutConsumer implements StrictServerInterface. The body replaces the filter; start applies on create only, and no PUT moves acked_seq.

func (*Server) PutSecret

PutSecret implements StrictServerInterface.

func (*Server) PutSink

PutSink implements StrictServerInterface.

func (*Server) PutSubscription

PutSubscription implements StrictServerInterface.

func (*Server) PutWatch

PutWatch implements StrictServerInterface.

func (*Server) ReplayDelivery

ReplayDelivery implements StrictServerInterface. The replay keeps attempts and starts a new retry budget (store.Delivery.ReplayBaseAttempts, spec docs/api.md decision 28).

func (*Server) RevokeToken added in v0.2.0

RevokeToken implements StrictServerInterface. Revoking a revoked token is 204 too and changes nothing; the revoker is the caller's token id.

func (*Server) Role

func (s *Server) Role() supervisor.Role

Role returns the api role of `angelia serve`: it mounts the API on the shared listener under /v1/ (and MCP at /mcp when Options.MCP is set) and, once shutdown starts, drains it (503 with Retry-After for new requests, open event streams closed).

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP runs the pipeline: drain check, route, authentication and scope (before anything that could reveal whether a resource exists), body limits, validation against the specification, then the generated router and the handlers. MCPPath takes the same drain check and authentication, then serveMCP; its scopes are checked per tool call by the REST calls.

func (*Server) StreamEvents

StreamEvents implements StrictServerInterface: GET /v1/events/stream as server-sent events (spec docs/api.md decision 15).

type ServerInterface

type ServerInterface interface {
	// ListConsumers List consumers
	// (GET /v1/consumers)
	ListConsumers(w http.ResponseWriter, r *http.Request, params ListConsumersParams)
	// DeleteConsumer Delete a consumer
	// (DELETE /v1/consumers/{name})
	DeleteConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName, params DeleteConsumerParams)
	// GetConsumer Get a consumer
	// (GET /v1/consumers/{name})
	GetConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName)
	// PutConsumer Create or update a consumer
	// (PUT /v1/consumers/{name})
	PutConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName, params PutConsumerParams)
	// AckConsumer Acknowledge events up to a position
	// (POST /v1/consumers/{name}/ack)
	AckConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName)
	// ListDeliveries List deliveries
	// (GET /v1/deliveries)
	ListDeliveries(w http.ResponseWriter, r *http.Request, params ListDeliveriesParams)
	// GetDelivery Get a delivery
	// (GET /v1/deliveries/{id})
	GetDelivery(w http.ResponseWriter, r *http.Request, id DeliveryId)
	// ReplayDelivery Replay a delivery
	// (POST /v1/deliveries/{id}/replay)
	ReplayDelivery(w http.ResponseWriter, r *http.Request, id DeliveryId)
	// ListEvents Pull events after a cursor
	// (GET /v1/events)
	ListEvents(w http.ResponseWriter, r *http.Request, params ListEventsParams)
	// StreamEvents Stream events (server-sent events)
	// (GET /v1/events/stream)
	StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)
	// GetEvent Get an event
	// (GET /v1/events/{id})
	GetEvent(w http.ResponseWriter, r *http.Request, id Ulid)
	// ListPlugins List plugins
	// (GET /v1/plugins)
	ListPlugins(w http.ResponseWriter, r *http.Request, params ListPluginsParams)
	// GetPlugin Get a plugin
	// (GET /v1/plugins/{interface}/{kind})
	GetPlugin(w http.ResponseWriter, r *http.Request, pInterface PluginInterface, kind Kind)
	// CreateReplay Replay deliveries in bulk
	// (POST /v1/replays)
	CreateReplay(w http.ResponseWriter, r *http.Request)
	// ListSecrets List secrets
	// (GET /v1/secrets)
	ListSecrets(w http.ResponseWriter, r *http.Request, params ListSecretsParams)
	// DeleteSecret Delete a secret
	// (DELETE /v1/secrets/{name})
	DeleteSecret(w http.ResponseWriter, r *http.Request, name SecretName, params DeleteSecretParams)
	// GetSecret Get a secret's metadata
	// (GET /v1/secrets/{name})
	GetSecret(w http.ResponseWriter, r *http.Request, name SecretName)
	// PutSecret Create or replace a secret
	// (PUT /v1/secrets/{name})
	PutSecret(w http.ResponseWriter, r *http.Request, name SecretName, params PutSecretParams)
	// ListSinks List sinks
	// (GET /v1/sinks)
	ListSinks(w http.ResponseWriter, r *http.Request, params ListSinksParams)
	// DeleteSink Delete a sink
	// (DELETE /v1/sinks/{name})
	DeleteSink(w http.ResponseWriter, r *http.Request, name SinkName, params DeleteSinkParams)
	// GetSink Get a sink
	// (GET /v1/sinks/{name})
	GetSink(w http.ResponseWriter, r *http.Request, name SinkName)
	// PutSink Create or replace a sink
	// (PUT /v1/sinks/{name})
	PutSink(w http.ResponseWriter, r *http.Request, name SinkName, params PutSinkParams)
	// ListSubscriptions List subscriptions
	// (GET /v1/subscriptions)
	ListSubscriptions(w http.ResponseWriter, r *http.Request, params ListSubscriptionsParams)
	// DeleteSubscription Delete a subscription
	// (DELETE /v1/subscriptions/{name})
	DeleteSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName, params DeleteSubscriptionParams)
	// GetSubscription Get a subscription
	// (GET /v1/subscriptions/{name})
	GetSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName)
	// PutSubscription Create or replace a subscription
	// (PUT /v1/subscriptions/{name})
	PutSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName, params PutSubscriptionParams)
	// ListTokens List API tokens
	// (GET /v1/tokens)
	ListTokens(w http.ResponseWriter, r *http.Request, params ListTokensParams)
	// CreateToken Create an API token
	// (POST /v1/tokens)
	CreateToken(w http.ResponseWriter, r *http.Request)
	// RevokeToken Revoke an API token
	// (DELETE /v1/tokens/{id})
	RevokeToken(w http.ResponseWriter, r *http.Request, id TokenId)
	// GetToken Get an API token's metadata
	// (GET /v1/tokens/{id})
	GetToken(w http.ResponseWriter, r *http.Request, id TokenId)
	// ListWatches List watches
	// (GET /v1/watches)
	ListWatches(w http.ResponseWriter, r *http.Request, params ListWatchesParams)
	// DeleteWatch Delete a watch
	// (DELETE /v1/watches/{name})
	DeleteWatch(w http.ResponseWriter, r *http.Request, name WatchName, params DeleteWatchParams)
	// GetWatch Get a watch
	// (GET /v1/watches/{name})
	GetWatch(w http.ResponseWriter, r *http.Request, name WatchName)
	// PutWatch Create or replace a watch
	// (PUT /v1/watches/{name})
	PutWatch(w http.ResponseWriter, r *http.Request, name WatchName, params PutWatchParams)
	// ListWatchVersions List the known versions of a watch
	// (GET /v1/watches/{name}/versions)
	ListWatchVersions(w http.ResponseWriter, r *http.Request, name WatchName, params ListWatchVersionsParams)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AckConsumer added in v0.2.0

func (siw *ServerInterfaceWrapper) AckConsumer(w http.ResponseWriter, r *http.Request)

AckConsumer operation middleware

func (*ServerInterfaceWrapper) CreateReplay

func (siw *ServerInterfaceWrapper) CreateReplay(w http.ResponseWriter, r *http.Request)

CreateReplay operation middleware

func (*ServerInterfaceWrapper) CreateToken added in v0.2.0

func (siw *ServerInterfaceWrapper) CreateToken(w http.ResponseWriter, r *http.Request)

CreateToken operation middleware

func (*ServerInterfaceWrapper) DeleteConsumer added in v0.2.0

func (siw *ServerInterfaceWrapper) DeleteConsumer(w http.ResponseWriter, r *http.Request)

DeleteConsumer operation middleware

func (*ServerInterfaceWrapper) DeleteSecret

func (siw *ServerInterfaceWrapper) DeleteSecret(w http.ResponseWriter, r *http.Request)

DeleteSecret operation middleware

func (*ServerInterfaceWrapper) DeleteSink

func (siw *ServerInterfaceWrapper) DeleteSink(w http.ResponseWriter, r *http.Request)

DeleteSink operation middleware

func (*ServerInterfaceWrapper) DeleteSubscription

func (siw *ServerInterfaceWrapper) DeleteSubscription(w http.ResponseWriter, r *http.Request)

DeleteSubscription operation middleware

func (*ServerInterfaceWrapper) DeleteWatch

func (siw *ServerInterfaceWrapper) DeleteWatch(w http.ResponseWriter, r *http.Request)

DeleteWatch operation middleware

func (*ServerInterfaceWrapper) GetConsumer added in v0.2.0

func (siw *ServerInterfaceWrapper) GetConsumer(w http.ResponseWriter, r *http.Request)

GetConsumer operation middleware

func (*ServerInterfaceWrapper) GetDelivery

func (siw *ServerInterfaceWrapper) GetDelivery(w http.ResponseWriter, r *http.Request)

GetDelivery operation middleware

func (*ServerInterfaceWrapper) GetEvent

func (siw *ServerInterfaceWrapper) GetEvent(w http.ResponseWriter, r *http.Request)

GetEvent operation middleware

func (*ServerInterfaceWrapper) GetPlugin

func (siw *ServerInterfaceWrapper) GetPlugin(w http.ResponseWriter, r *http.Request)

GetPlugin operation middleware

func (*ServerInterfaceWrapper) GetSecret

func (siw *ServerInterfaceWrapper) GetSecret(w http.ResponseWriter, r *http.Request)

GetSecret operation middleware

func (*ServerInterfaceWrapper) GetSink

GetSink operation middleware

func (*ServerInterfaceWrapper) GetSubscription

func (siw *ServerInterfaceWrapper) GetSubscription(w http.ResponseWriter, r *http.Request)

GetSubscription operation middleware

func (*ServerInterfaceWrapper) GetToken added in v0.2.0

func (siw *ServerInterfaceWrapper) GetToken(w http.ResponseWriter, r *http.Request)

GetToken operation middleware

func (*ServerInterfaceWrapper) GetWatch

func (siw *ServerInterfaceWrapper) GetWatch(w http.ResponseWriter, r *http.Request)

GetWatch operation middleware

func (*ServerInterfaceWrapper) ListConsumers added in v0.2.0

func (siw *ServerInterfaceWrapper) ListConsumers(w http.ResponseWriter, r *http.Request)

ListConsumers operation middleware

func (*ServerInterfaceWrapper) ListDeliveries

func (siw *ServerInterfaceWrapper) ListDeliveries(w http.ResponseWriter, r *http.Request)

ListDeliveries operation middleware

func (*ServerInterfaceWrapper) ListEvents

func (siw *ServerInterfaceWrapper) ListEvents(w http.ResponseWriter, r *http.Request)

ListEvents operation middleware

func (*ServerInterfaceWrapper) ListPlugins

func (siw *ServerInterfaceWrapper) ListPlugins(w http.ResponseWriter, r *http.Request)

ListPlugins operation middleware

func (*ServerInterfaceWrapper) ListSecrets

func (siw *ServerInterfaceWrapper) ListSecrets(w http.ResponseWriter, r *http.Request)

ListSecrets operation middleware

func (*ServerInterfaceWrapper) ListSinks

func (siw *ServerInterfaceWrapper) ListSinks(w http.ResponseWriter, r *http.Request)

ListSinks operation middleware

func (*ServerInterfaceWrapper) ListSubscriptions

func (siw *ServerInterfaceWrapper) ListSubscriptions(w http.ResponseWriter, r *http.Request)

ListSubscriptions operation middleware

func (*ServerInterfaceWrapper) ListTokens added in v0.2.0

func (siw *ServerInterfaceWrapper) ListTokens(w http.ResponseWriter, r *http.Request)

ListTokens operation middleware

func (*ServerInterfaceWrapper) ListWatchVersions

func (siw *ServerInterfaceWrapper) ListWatchVersions(w http.ResponseWriter, r *http.Request)

ListWatchVersions operation middleware

func (*ServerInterfaceWrapper) ListWatches

func (siw *ServerInterfaceWrapper) ListWatches(w http.ResponseWriter, r *http.Request)

ListWatches operation middleware

func (*ServerInterfaceWrapper) PutConsumer added in v0.2.0

func (siw *ServerInterfaceWrapper) PutConsumer(w http.ResponseWriter, r *http.Request)

PutConsumer operation middleware

func (*ServerInterfaceWrapper) PutSecret

func (siw *ServerInterfaceWrapper) PutSecret(w http.ResponseWriter, r *http.Request)

PutSecret operation middleware

func (*ServerInterfaceWrapper) PutSink

PutSink operation middleware

func (*ServerInterfaceWrapper) PutSubscription

func (siw *ServerInterfaceWrapper) PutSubscription(w http.ResponseWriter, r *http.Request)

PutSubscription operation middleware

func (*ServerInterfaceWrapper) PutWatch

func (siw *ServerInterfaceWrapper) PutWatch(w http.ResponseWriter, r *http.Request)

PutWatch operation middleware

func (*ServerInterfaceWrapper) ReplayDelivery

func (siw *ServerInterfaceWrapper) ReplayDelivery(w http.ResponseWriter, r *http.Request)

ReplayDelivery operation middleware

func (*ServerInterfaceWrapper) RevokeToken added in v0.2.0

func (siw *ServerInterfaceWrapper) RevokeToken(w http.ResponseWriter, r *http.Request)

RevokeToken operation middleware

func (*ServerInterfaceWrapper) StreamEvents

func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request)

StreamEvents operation middleware

type ShortEventType

type ShortEventType string

ShortEventType An event type without the `dev.angelia.` prefix and the `.v<major>` suffix.

const (
	ReleasePrerelease ShortEventType = "release.prerelease"
	ReleasePublished  ShortEventType = "release.published"
	ReleaseYanked     ShortEventType = "release.yanked"
)

Defines values for ShortEventType.

func (ShortEventType) Valid

func (e ShortEventType) Valid() bool

Valid indicates whether the value is a known member of the ShortEventType enum.

type Sink

type Sink struct {
	// Config Kind-owned configuration, free-form here and validated against the kind's `config_schema`
	// (`GET /v1/plugins/sink/{kind}`); unknown keys are errors. No secret values: a secret is
	// named by a `*_ref` key (the name of a stored secret, `/v1/secrets`) or by a `*_env` key
	// (an environment variable of the instance, as in the watch file); a `*_env` name set
	// through the API must be allowed by the instance configuration (`422 env-not-allowed`).
	// `*_ref` and `*_env` values are names, never secrets, and are returned as written. A key
	// the `config_schema` marks `x-angelia-destination: true` is the URL a referenced secret is
	// sent to, checked against the secret's `hosts`. A reference key the `config_schema` marks
	// `x-angelia-secret-destination: true` names a secret whose whole value is the destination
	// (a `shoutrrr` service URL): the server checks the HTTP hosts derived from that value against
	// the SSRF guard and the secret's `hosts` at every delivery. A key the `config_schema` marks
	// `x-angelia-secret: true` cannot be set through the API. The configuration of each built-in kind is listed in
	// `x-angelia-kind-config`.
	Config SinkConfig `json:"config"`

	// Id Generated when the sink is created; kept across updates.
	Id Ulid `json:"id"`

	// Kind A registered sink kind (`GET /v1/plugins?interface=sink`).
	Kind Kind `json:"kind"`

	// ManagedBy Who owns the resource. `api`: created through this API (or `angelia apply`). `file`:
	// created from a watch file loaded with `angelia serve --watches`; the API reads it but
	// refuses to change or delete it (`409 managed-by-file`).
	ManagedBy ManagedBy `json:"managed_by"`

	// MaskedFields The `config` keys replaced by `[REDACTED]` because the kind marks them secret, sorted.
	MaskedFields []string `json:"masked_fields"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// UrlRedacted Whether the URLs in `config` were cut to `scheme://host` because the token's scope is below `admin`.
	UrlRedacted bool `json:"url_redacted"`
}

Sink A sink as the server returns it, with every default filled in. Below the `admin` scope, every URL in `config` is cut to `scheme://host` and `url_redacted` is true. For every caller, a key the kind's `config_schema` marks `x-angelia-secret: true` is replaced by `[REDACTED]` and listed in `masked_fields`.

type SinkConfig

type SinkConfig map[string]interface{}

SinkConfig Kind-owned configuration, free-form here and validated against the kind's `config_schema` (`GET /v1/plugins/sink/{kind}`); unknown keys are errors. No secret values: a secret is named by a `*_ref` key (the name of a stored secret, `/v1/secrets`) or by a `*_env` key (an environment variable of the instance, as in the watch file); a `*_env` name set through the API must be allowed by the instance configuration (`422 env-not-allowed`). `*_ref` and `*_env` values are names, never secrets, and are returned as written. A key the `config_schema` marks `x-angelia-destination: true` is the URL a referenced secret is sent to, checked against the secret's `hosts`. A reference key the `config_schema` marks `x-angelia-secret-destination: true` names a secret whose whole value is the destination (a `shoutrrr` service URL): the server checks the HTTP hosts derived from that value against the SSRF guard and the secret's `hosts` at every delivery. A key the `config_schema` marks `x-angelia-secret: true` cannot be set through the API. The configuration of each built-in kind is listed in `x-angelia-kind-config`.

type SinkName

type SinkName = Name

SinkName The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type SinkPage

type SinkPage struct {
	Items []Sink `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

SinkPage defines model for SinkPage.

type SinkWrite

type SinkWrite struct {
	// Config Kind-owned configuration, free-form here and validated against the kind's `config_schema`
	// (`GET /v1/plugins/sink/{kind}`); unknown keys are errors. No secret values: a secret is
	// named by a `*_ref` key (the name of a stored secret, `/v1/secrets`) or by a `*_env` key
	// (an environment variable of the instance, as in the watch file); a `*_env` name set
	// through the API must be allowed by the instance configuration (`422 env-not-allowed`).
	// `*_ref` and `*_env` values are names, never secrets, and are returned as written. A key
	// the `config_schema` marks `x-angelia-destination: true` is the URL a referenced secret is
	// sent to, checked against the secret's `hosts`. A reference key the `config_schema` marks
	// `x-angelia-secret-destination: true` names a secret whose whole value is the destination
	// (a `shoutrrr` service URL): the server checks the HTTP hosts derived from that value against
	// the SSRF guard and the secret's `hosts` at every delivery. A key the `config_schema` marks
	// `x-angelia-secret: true` cannot be set through the API. The configuration of each built-in kind is listed in
	// `x-angelia-kind-config`.
	Config SinkConfig `json:"config"`

	// Kind A registered sink kind (`GET /v1/plugins?interface=sink`).
	Kind Kind `json:"kind"`

	// Name Optional; when given it must equal the name in the path.
	Name *Name `json:"name,omitempty"`
}

SinkWrite The body of `PUT /v1/sinks/{name}`: the keys of `sinks[]` in the watch file. It carries no secret values: a secret is named by a `*_ref` or `*_env` key of `config`.

type SourceFilter

type SourceFilter = []Kind

SourceFilter defines model for SourceFilter.

type StreamEventsParams

type StreamEventsParams struct {
	// After Return the events whose `seq` is greater than this. `0` (the default) starts at the oldest event kept.
	After *After `form:"after,omitempty" json:"after,omitempty"`

	// Watch Only events of these watches, each given by name or by id. A name (always lower case)
	// means the watch's current id; an id (a ULID, always upper case) also matches events of a
	// watch that was deleted or renamed.
	Watch *WatchFilter `form:"watch,omitempty" json:"watch,omitempty"`

	// Type Only events of these short types (as in a subscription filter).
	Type *TypeFilter `form:"type,omitempty" json:"type,omitempty"`

	// Source Only watches (or events of watches) with these sources. On watches it matches the watch's `source` (a kind or a configured instance name); on events it matches `data.source`, which is always the base kind.
	Source *SourceFilter `form:"source,omitempty" json:"source,omitempty"`

	// Consumer Read through this consumer: start after its `acked_seq`, with its stored filter. Exclusive
	// with `after`, `watch`, `type` and `source` by presence: sending any of them with `consumer`,
	// even `after=0` or an empty value, gets `400`. Reading never moves
	// the consumer's cursor; `POST /v1/consumers/{name}/ack` does.
	Consumer *ConsumerParam `form:"consumer,omitempty" json:"consumer,omitempty"`

	// LastEventID The `seq` of the last event the client received. Takes precedence over `after` and over a consumer's `acked_seq`.
	LastEventID *Seq `json:"Last-Event-ID,omitempty"`
}

StreamEventsParams defines parameters for StreamEvents.

type StreamEventsRequestObject

type StreamEventsRequestObject struct {
	Params StreamEventsParams
}

type StreamEventsResponseObject

type StreamEventsResponseObject interface {
	VisitStreamEventsResponse(w http.ResponseWriter) error
}

type StreamMetrics added in v0.1.2

type StreamMetrics interface {
	EventStreamOpened()
	EventStreamClosed()
}

StreamMetrics observes the open event streams. metrics.Metrics implements it.

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc

type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// ListConsumers List consumers
	// (GET /v1/consumers)
	ListConsumers(ctx context.Context, request ListConsumersRequestObject) (ListConsumersResponseObject, error)
	// DeleteConsumer Delete a consumer
	// (DELETE /v1/consumers/{name})
	DeleteConsumer(ctx context.Context, request DeleteConsumerRequestObject) (DeleteConsumerResponseObject, error)
	// GetConsumer Get a consumer
	// (GET /v1/consumers/{name})
	GetConsumer(ctx context.Context, request GetConsumerRequestObject) (GetConsumerResponseObject, error)
	// PutConsumer Create or update a consumer
	// (PUT /v1/consumers/{name})
	PutConsumer(ctx context.Context, request PutConsumerRequestObject) (PutConsumerResponseObject, error)
	// AckConsumer Acknowledge events up to a position
	// (POST /v1/consumers/{name}/ack)
	AckConsumer(ctx context.Context, request AckConsumerRequestObject) (AckConsumerResponseObject, error)
	// ListDeliveries List deliveries
	// (GET /v1/deliveries)
	ListDeliveries(ctx context.Context, request ListDeliveriesRequestObject) (ListDeliveriesResponseObject, error)
	// GetDelivery Get a delivery
	// (GET /v1/deliveries/{id})
	GetDelivery(ctx context.Context, request GetDeliveryRequestObject) (GetDeliveryResponseObject, error)
	// ReplayDelivery Replay a delivery
	// (POST /v1/deliveries/{id}/replay)
	ReplayDelivery(ctx context.Context, request ReplayDeliveryRequestObject) (ReplayDeliveryResponseObject, error)
	// ListEvents Pull events after a cursor
	// (GET /v1/events)
	ListEvents(ctx context.Context, request ListEventsRequestObject) (ListEventsResponseObject, error)
	// StreamEvents Stream events (server-sent events)
	// (GET /v1/events/stream)
	StreamEvents(ctx context.Context, request StreamEventsRequestObject) (StreamEventsResponseObject, error)
	// GetEvent Get an event
	// (GET /v1/events/{id})
	GetEvent(ctx context.Context, request GetEventRequestObject) (GetEventResponseObject, error)
	// ListPlugins List plugins
	// (GET /v1/plugins)
	ListPlugins(ctx context.Context, request ListPluginsRequestObject) (ListPluginsResponseObject, error)
	// GetPlugin Get a plugin
	// (GET /v1/plugins/{interface}/{kind})
	GetPlugin(ctx context.Context, request GetPluginRequestObject) (GetPluginResponseObject, error)
	// CreateReplay Replay deliveries in bulk
	// (POST /v1/replays)
	CreateReplay(ctx context.Context, request CreateReplayRequestObject) (CreateReplayResponseObject, error)
	// ListSecrets List secrets
	// (GET /v1/secrets)
	ListSecrets(ctx context.Context, request ListSecretsRequestObject) (ListSecretsResponseObject, error)
	// DeleteSecret Delete a secret
	// (DELETE /v1/secrets/{name})
	DeleteSecret(ctx context.Context, request DeleteSecretRequestObject) (DeleteSecretResponseObject, error)
	// GetSecret Get a secret's metadata
	// (GET /v1/secrets/{name})
	GetSecret(ctx context.Context, request GetSecretRequestObject) (GetSecretResponseObject, error)
	// PutSecret Create or replace a secret
	// (PUT /v1/secrets/{name})
	PutSecret(ctx context.Context, request PutSecretRequestObject) (PutSecretResponseObject, error)
	// ListSinks List sinks
	// (GET /v1/sinks)
	ListSinks(ctx context.Context, request ListSinksRequestObject) (ListSinksResponseObject, error)
	// DeleteSink Delete a sink
	// (DELETE /v1/sinks/{name})
	DeleteSink(ctx context.Context, request DeleteSinkRequestObject) (DeleteSinkResponseObject, error)
	// GetSink Get a sink
	// (GET /v1/sinks/{name})
	GetSink(ctx context.Context, request GetSinkRequestObject) (GetSinkResponseObject, error)
	// PutSink Create or replace a sink
	// (PUT /v1/sinks/{name})
	PutSink(ctx context.Context, request PutSinkRequestObject) (PutSinkResponseObject, error)
	// ListSubscriptions List subscriptions
	// (GET /v1/subscriptions)
	ListSubscriptions(ctx context.Context, request ListSubscriptionsRequestObject) (ListSubscriptionsResponseObject, error)
	// DeleteSubscription Delete a subscription
	// (DELETE /v1/subscriptions/{name})
	DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequestObject) (DeleteSubscriptionResponseObject, error)
	// GetSubscription Get a subscription
	// (GET /v1/subscriptions/{name})
	GetSubscription(ctx context.Context, request GetSubscriptionRequestObject) (GetSubscriptionResponseObject, error)
	// PutSubscription Create or replace a subscription
	// (PUT /v1/subscriptions/{name})
	PutSubscription(ctx context.Context, request PutSubscriptionRequestObject) (PutSubscriptionResponseObject, error)
	// ListTokens List API tokens
	// (GET /v1/tokens)
	ListTokens(ctx context.Context, request ListTokensRequestObject) (ListTokensResponseObject, error)
	// CreateToken Create an API token
	// (POST /v1/tokens)
	CreateToken(ctx context.Context, request CreateTokenRequestObject) (CreateTokenResponseObject, error)
	// RevokeToken Revoke an API token
	// (DELETE /v1/tokens/{id})
	RevokeToken(ctx context.Context, request RevokeTokenRequestObject) (RevokeTokenResponseObject, error)
	// GetToken Get an API token's metadata
	// (GET /v1/tokens/{id})
	GetToken(ctx context.Context, request GetTokenRequestObject) (GetTokenResponseObject, error)
	// ListWatches List watches
	// (GET /v1/watches)
	ListWatches(ctx context.Context, request ListWatchesRequestObject) (ListWatchesResponseObject, error)
	// DeleteWatch Delete a watch
	// (DELETE /v1/watches/{name})
	DeleteWatch(ctx context.Context, request DeleteWatchRequestObject) (DeleteWatchResponseObject, error)
	// GetWatch Get a watch
	// (GET /v1/watches/{name})
	GetWatch(ctx context.Context, request GetWatchRequestObject) (GetWatchResponseObject, error)
	// PutWatch Create or replace a watch
	// (PUT /v1/watches/{name})
	PutWatch(ctx context.Context, request PutWatchRequestObject) (PutWatchResponseObject, error)
	// ListWatchVersions List the known versions of a watch
	// (GET /v1/watches/{name}/versions)
	ListWatchVersions(ctx context.Context, request ListWatchVersionsRequestObject) (ListWatchVersionsResponseObject, error)
}

StrictServerInterface represents all server handlers.

type Subscription

type Subscription struct {
	// Filter All given keys must match. An empty filter matches every `release.published` event.
	Filter SubscriptionFilter `json:"filter"`

	// Id Generated when the subscription is created; kept across updates. Part of the idempotency key of its deliveries.
	Id Ulid `json:"id"`

	// ManagedBy Who owns the resource. `api`: created through this API (or `angelia apply`). `file`:
	// created from a watch file loaded with `angelia serve --watches`; the API reads it but
	// refuses to change or delete it (`409 managed-by-file`).
	ManagedBy ManagedBy `json:"managed_by"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// Policy Narrows the watch's policy for this subscription only; it can never widen it.
	Policy SubscriptionPolicy `json:"policy"`

	// Sink The name of an existing sink managed like this subscription (`managed_by` must match, else `409 cross-owner-reference`).
	Sink Name `json:"sink"`

	// Template A Go `text/template` over the event (`.data.package`, ...). Empty sends the CloudEvents JSON. Checked against the sample events when written.
	Template string `json:"template"`
}

Subscription A subscription as the server returns it, with every default filled in.

type SubscriptionFilter

type SubscriptionFilter struct {
	// Bump Bumps. Empty means any. Narrows the watch's `policy.bump`.
	Bump *[]Bump `json:"bump,omitempty"`

	// Labels The event's watch must carry all of these labels with equal values.
	//
	// Examples: {"team":"platform"}
	Labels *Labels `json:"labels,omitempty"`

	// Package A glob (Go `path.Match` syntax) on the package name. Empty means any.
	Package *string `json:"package,omitempty"`

	// Source Source kinds. Empty means any.
	Source *[]Kind `json:"source,omitempty"`

	// Type Short event types.
	Type *[]ShortEventType `json:"type,omitempty"`
}

SubscriptionFilter All given keys must match. An empty filter matches every `release.published` event.

type SubscriptionName

type SubscriptionName = Name

SubscriptionName The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type SubscriptionPage

type SubscriptionPage struct {
	Items []Subscription `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

SubscriptionPage defines model for SubscriptionPage.

type SubscriptionPolicy

type SubscriptionPolicy struct {
	// Cooldown The effective hold is the larger of this and the watch's cooldown, counted from the same start. Clamped to `0` to `8760h` (a negative value becomes `0`), as in the watch file.
	Cooldown *Duration `json:"cooldown,omitempty"`

	// Prerelease Intersected with what the watch admits. `null` inherits the watch's mode.
	Prerelease *PrereleaseMode `json:"prerelease,omitempty"`
}

SubscriptionPolicy Narrows the watch's policy for this subscription only; it can never widen it.

type SubscriptionWrite

type SubscriptionWrite struct {
	// Filter All given keys must match. An empty filter matches every `release.published` event.
	Filter *SubscriptionFilter `json:"filter,omitempty"`

	// Name Optional; when given it must equal the name in the path.
	Name *Name `json:"name,omitempty"`

	// Policy Narrows the watch's policy for this subscription only; it can never widen it.
	Policy *SubscriptionPolicy `json:"policy,omitempty"`

	// Sink The name of an existing sink managed like this subscription (`managed_by` must match, else `409 cross-owner-reference`).
	Sink Name `json:"sink"`

	// Template A Go `text/template` over the event (`.data.package`, ...). Empty sends the CloudEvents JSON. Checked against the sample events when written.
	Template *string `json:"template,omitempty"`
}

SubscriptionWrite The body of `PUT /v1/subscriptions/{name}`. Same keys as `subscriptions[]` in the watch file.

type Timestamp

type Timestamp = time.Time

Timestamp RFC 3339 timestamp in UTC with a Z suffix and at most millisecond precision (the server always sends milliseconds).

Examples: 2026-10-30T17:00:02.512Z

type Token added in v0.2.0

type Token struct {
	// CreatedAt RFC 3339 timestamp in UTC with a Z suffix and at most millisecond precision (the server always sends milliseconds).
	//
	// Examples: 2026-10-30T17:00:02.512Z
	CreatedAt Timestamp `json:"created_at"`

	// CreatedBy Who created or revoked a token, an API token's id, or `bootstrap` (the bootstrap file) or `local` (an instance-side command).
	CreatedBy TokenActor `json:"created_by"`

	// ExpiresAt When the token stops working, or `null` if it never expires. An expired token is `401`, like an unknown one, and stays listed.
	ExpiresAt *Timestamp `json:"expires_at"`

	// Id Generated when the token is created, never reused. It is the ULID inside the `ang_` token, so a leaked token found by a scanner can be revoked by id.
	Id Ulid `json:"id"`

	// LastUsedAt When the token last authenticated a request, or `null` if it never has. Accurate to about 5 minutes, and a crash can lose the last interval.
	LastUsedAt *Timestamp `json:"last_used_at"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// RevokedAt When the token was revoked, or `null` while it is active.
	RevokedAt *Timestamp `json:"revoked_at"`

	// RevokedBy Who revoked the token, or `null` while it is active.
	RevokedBy *TokenActor `json:"revoked_by"`

	// Scope The one scope of a token; the scopes are ordered `read` < `write` < `admin`.
	Scope TokenScope `json:"scope"`
}

Token An API token as the server returns it: metadata only. No scope, flag or parameter returns the token or its hash, except the one `201` of `POST /v1/tokens` (`TokenCreated`).

type TokenActor added in v0.2.0

type TokenActor = string

TokenActor Who created or revoked a token, an API token's id, or `bootstrap` (the bootstrap file) or `local` (an instance-side command).

type TokenCreate added in v0.2.0

type TokenCreate struct {
	// ExpiresAt When the token stops working, in the future. Absent means never.
	//
	// Examples: 2026-10-30T17:00:02.512Z
	ExpiresAt *Timestamp `json:"expires_at,omitempty"`

	// Name An operator label, unique among tokens that are not revoked. It is not a key, since tokens are addressed by `id`.
	Name Name `json:"name"`

	// Scope The one scope of a token; the scopes are ordered `read` < `write` < `admin`.
	Scope TokenScope `json:"scope"`
}

TokenCreate The body of `POST /v1/tokens`. `name` is a label for operators and must be unique among active tokens; `scope` is the token's one scope; `expires_at`, when given, must be in the future. A token with no `expires_at` never expires.

type TokenCreated added in v0.2.0

type TokenCreated struct {
	// CreatedAt RFC 3339 timestamp in UTC with a Z suffix and at most millisecond precision (the server always sends milliseconds).
	//
	// Examples: 2026-10-30T17:00:02.512Z
	CreatedAt Timestamp `json:"created_at"`

	// CreatedBy Who created or revoked a token, an API token's id, or `bootstrap` (the bootstrap file) or `local` (an instance-side command).
	CreatedBy TokenActor `json:"created_by"`

	// ExpiresAt When the token stops working, or `null` if it never expires. An expired token is `401`, like an unknown one, and stays listed.
	ExpiresAt *Timestamp `json:"expires_at"`

	// Id Generated when the token is created, never reused. It is the ULID inside the `ang_` token, so a leaked token found by a scanner can be revoked by id.
	Id Ulid `json:"id"`

	// LastUsedAt When the token last authenticated a request, or `null` if it never has. Accurate to about 5 minutes, and a crash can lose the last interval.
	LastUsedAt *Timestamp `json:"last_used_at"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// RevokedAt When the token was revoked, or `null` while it is active.
	RevokedAt *Timestamp `json:"revoked_at"`

	// RevokedBy Who revoked the token, or `null` while it is active.
	RevokedBy *TokenActor `json:"revoked_by"`

	// Scope The one scope of a token; the scopes are ordered `read` < `write` < `admin`.
	Scope TokenScope `json:"scope"`

	// Token The API token, to send as `Authorization: Bearer <token>`: `ang_`, the token's `id`,
	// `_`, 52 characters of random secret and a 7-character CRC-32 check (90 characters,
	// lower-case base32 after the id). Store it now.
	Token *string `json:"token,omitempty"`
}

TokenCreated The `201` response of `POST /v1/tokens`: the `Token` plus `token`, the one place the secret is ever returned. It is shown once and cannot be read again; the server keeps a hash. The member is deliberately named `token`: a Spectral rule allows it on this schema only.

type TokenId added in v0.2.0

type TokenId = Ulid

TokenId ULID: 26 characters, Crockford base32, upper case.

type TokenPage added in v0.2.0

type TokenPage struct {
	Items []Token `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

TokenPage defines model for TokenPage.

type TokenScope added in v0.2.0

type TokenScope string

TokenScope The one scope of a token; the scopes are ordered `read` < `write` < `admin`.

const (
	TokenScopeAdmin TokenScope = "admin"
	TokenScopeRead  TokenScope = "read"
	TokenScopeWrite TokenScope = "write"
)

Defines values for TokenScope.

func (TokenScope) Valid added in v0.2.0

func (e TokenScope) Valid() bool

Valid indicates whether the value is a known member of the TokenScope enum.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type TypeFilter

type TypeFilter = []ShortEventType

TypeFilter defines model for TypeFilter.

type Ulid

type Ulid = string

Ulid ULID: 26 characters, Crockford base32, upper case.

type Unauthorized

type Unauthorized = Problem

Unauthorized RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type UnauthorizedApplicationProblemPlusJSONResponse

type UnauthorizedApplicationProblemPlusJSONResponse struct {
	Body Problem

	Headers UnauthorizedResponseHeaders
}

type UnauthorizedResponseHeaders

type UnauthorizedResponseHeaders struct {
	WWWAuthenticate *string
}

type Unavailable

type Unavailable = Problem

Unavailable RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type UnavailableApplicationProblemPlusJSONResponse

type UnavailableApplicationProblemPlusJSONResponse struct {
	Body Problem

	Headers UnavailableResponseHeaders
}

type UnavailableResponseHeaders

type UnavailableResponseHeaders struct {
	RetryAfter *int
}

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) AckConsumer added in v0.2.0

func (_ Unimplemented) AckConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName)

AckConsumer Acknowledge events up to a position (POST /v1/consumers/{name}/ack)

func (Unimplemented) CreateReplay

func (_ Unimplemented) CreateReplay(w http.ResponseWriter, r *http.Request)

CreateReplay Replay deliveries in bulk (POST /v1/replays)

func (Unimplemented) CreateToken added in v0.2.0

func (_ Unimplemented) CreateToken(w http.ResponseWriter, r *http.Request)

CreateToken Create an API token (POST /v1/tokens)

func (Unimplemented) DeleteConsumer added in v0.2.0

func (_ Unimplemented) DeleteConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName, params DeleteConsumerParams)

DeleteConsumer Delete a consumer (DELETE /v1/consumers/{name})

func (Unimplemented) DeleteSecret

func (_ Unimplemented) DeleteSecret(w http.ResponseWriter, r *http.Request, name SecretName, params DeleteSecretParams)

DeleteSecret Delete a secret (DELETE /v1/secrets/{name})

func (Unimplemented) DeleteSink

func (_ Unimplemented) DeleteSink(w http.ResponseWriter, r *http.Request, name SinkName, params DeleteSinkParams)

DeleteSink Delete a sink (DELETE /v1/sinks/{name})

func (Unimplemented) DeleteSubscription

func (_ Unimplemented) DeleteSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName, params DeleteSubscriptionParams)

DeleteSubscription Delete a subscription (DELETE /v1/subscriptions/{name})

func (Unimplemented) DeleteWatch

func (_ Unimplemented) DeleteWatch(w http.ResponseWriter, r *http.Request, name WatchName, params DeleteWatchParams)

DeleteWatch Delete a watch (DELETE /v1/watches/{name})

func (Unimplemented) GetConsumer added in v0.2.0

func (_ Unimplemented) GetConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName)

GetConsumer Get a consumer (GET /v1/consumers/{name})

func (Unimplemented) GetDelivery

func (_ Unimplemented) GetDelivery(w http.ResponseWriter, r *http.Request, id DeliveryId)

GetDelivery Get a delivery (GET /v1/deliveries/{id})

func (Unimplemented) GetEvent

func (_ Unimplemented) GetEvent(w http.ResponseWriter, r *http.Request, id Ulid)

GetEvent Get an event (GET /v1/events/{id})

func (Unimplemented) GetPlugin

func (_ Unimplemented) GetPlugin(w http.ResponseWriter, r *http.Request, pInterface PluginInterface, kind Kind)

GetPlugin Get a plugin (GET /v1/plugins/{interface}/{kind})

func (Unimplemented) GetSecret

func (_ Unimplemented) GetSecret(w http.ResponseWriter, r *http.Request, name SecretName)

GetSecret Get a secret's metadata (GET /v1/secrets/{name})

func (Unimplemented) GetSink

func (_ Unimplemented) GetSink(w http.ResponseWriter, r *http.Request, name SinkName)

GetSink Get a sink (GET /v1/sinks/{name})

func (Unimplemented) GetSubscription

func (_ Unimplemented) GetSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName)

GetSubscription Get a subscription (GET /v1/subscriptions/{name})

func (Unimplemented) GetToken added in v0.2.0

func (_ Unimplemented) GetToken(w http.ResponseWriter, r *http.Request, id TokenId)

GetToken Get an API token's metadata (GET /v1/tokens/{id})

func (Unimplemented) GetWatch

func (_ Unimplemented) GetWatch(w http.ResponseWriter, r *http.Request, name WatchName)

GetWatch Get a watch (GET /v1/watches/{name})

func (Unimplemented) ListConsumers added in v0.2.0

func (_ Unimplemented) ListConsumers(w http.ResponseWriter, r *http.Request, params ListConsumersParams)

ListConsumers List consumers (GET /v1/consumers)

func (Unimplemented) ListDeliveries

func (_ Unimplemented) ListDeliveries(w http.ResponseWriter, r *http.Request, params ListDeliveriesParams)

ListDeliveries List deliveries (GET /v1/deliveries)

func (Unimplemented) ListEvents

func (_ Unimplemented) ListEvents(w http.ResponseWriter, r *http.Request, params ListEventsParams)

ListEvents Pull events after a cursor (GET /v1/events)

func (Unimplemented) ListPlugins

func (_ Unimplemented) ListPlugins(w http.ResponseWriter, r *http.Request, params ListPluginsParams)

ListPlugins List plugins (GET /v1/plugins)

func (Unimplemented) ListSecrets

func (_ Unimplemented) ListSecrets(w http.ResponseWriter, r *http.Request, params ListSecretsParams)

ListSecrets List secrets (GET /v1/secrets)

func (Unimplemented) ListSinks

func (_ Unimplemented) ListSinks(w http.ResponseWriter, r *http.Request, params ListSinksParams)

ListSinks List sinks (GET /v1/sinks)

func (Unimplemented) ListSubscriptions

func (_ Unimplemented) ListSubscriptions(w http.ResponseWriter, r *http.Request, params ListSubscriptionsParams)

ListSubscriptions List subscriptions (GET /v1/subscriptions)

func (Unimplemented) ListTokens added in v0.2.0

func (_ Unimplemented) ListTokens(w http.ResponseWriter, r *http.Request, params ListTokensParams)

ListTokens List API tokens (GET /v1/tokens)

func (Unimplemented) ListWatchVersions

func (_ Unimplemented) ListWatchVersions(w http.ResponseWriter, r *http.Request, name WatchName, params ListWatchVersionsParams)

ListWatchVersions List the known versions of a watch (GET /v1/watches/{name}/versions)

func (Unimplemented) ListWatches

func (_ Unimplemented) ListWatches(w http.ResponseWriter, r *http.Request, params ListWatchesParams)

ListWatches List watches (GET /v1/watches)

func (Unimplemented) PutConsumer added in v0.2.0

func (_ Unimplemented) PutConsumer(w http.ResponseWriter, r *http.Request, name ConsumerName, params PutConsumerParams)

PutConsumer Create or update a consumer (PUT /v1/consumers/{name})

func (Unimplemented) PutSecret

func (_ Unimplemented) PutSecret(w http.ResponseWriter, r *http.Request, name SecretName, params PutSecretParams)

PutSecret Create or replace a secret (PUT /v1/secrets/{name})

func (Unimplemented) PutSink

func (_ Unimplemented) PutSink(w http.ResponseWriter, r *http.Request, name SinkName, params PutSinkParams)

PutSink Create or replace a sink (PUT /v1/sinks/{name})

func (Unimplemented) PutSubscription

func (_ Unimplemented) PutSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName, params PutSubscriptionParams)

PutSubscription Create or replace a subscription (PUT /v1/subscriptions/{name})

func (Unimplemented) PutWatch

func (_ Unimplemented) PutWatch(w http.ResponseWriter, r *http.Request, name WatchName, params PutWatchParams)

PutWatch Create or replace a watch (PUT /v1/watches/{name})

func (Unimplemented) ReplayDelivery

func (_ Unimplemented) ReplayDelivery(w http.ResponseWriter, r *http.Request, id DeliveryId)

ReplayDelivery Replay a delivery (POST /v1/deliveries/{id}/replay)

func (Unimplemented) RevokeToken added in v0.2.0

func (_ Unimplemented) RevokeToken(w http.ResponseWriter, r *http.Request, id TokenId)

RevokeToken Revoke an API token (DELETE /v1/tokens/{id})

func (Unimplemented) StreamEvents

func (_ Unimplemented) StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)

StreamEvents Stream events (server-sent events) (GET /v1/events/stream)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UnsupportedMediaType

type UnsupportedMediaType = Problem

UnsupportedMediaType RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type UnsupportedMediaTypeApplicationProblemPlusJSONResponse

type UnsupportedMediaTypeApplicationProblemPlusJSONResponse Problem

type ValidationFailed

type ValidationFailed = Problem

ValidationFailed RFC 9457 problem details. `type` is one of the URIs listed in docs/api.md (`about:blank` is not used); clients switch on `type`, never on `title` or `detail`. Unknown members must be ignored.

type ValidationFailedApplicationProblemPlusJSONResponse

type ValidationFailedApplicationProblemPlusJSONResponse Problem

type Version

type Version struct {
	// FirstSeenAt When this instance first saw it.
	//
	// Examples: 2026-10-30T17:00:02.512Z
	FirstSeenAt Timestamp `json:"first_seen_at"`

	// NormalizedVersion The version in the scheme's normalised form (`data.normalized_version` in events).
	//
	// Examples: 2.33.0
	NormalizedVersion string `json:"normalized_version"`

	// Prerelease Whether the scheme (or the upstream flag) classifies it as a pre-release.
	Prerelease bool `json:"prerelease"`

	// PublishedAt When upstream published it, or `null` when the source does not say.
	PublishedAt *Timestamp `json:"published_at"`

	// RemovedAt When it disappeared upstream, or `null` while it is listed.
	RemovedAt *Timestamp `json:"removed_at"`

	// Version The raw upstream version string (`data.version` in events).
	//
	// Examples: 2.33.0
	Version string `json:"version"`

	// Yanked Whether upstream marks it yanked (as of the last check).
	Yanked bool `json:"yanked"`
}

Version One upstream version of a watch's target, from the known set.

type VersionPage

type VersionPage struct {
	Items []Version `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

VersionPage defines model for VersionPage.

type Watch

type Watch struct {
	// Coordinates Source-owned parameters that name the upstream object (`pypi`, `npm`, `crates`: `name`; `github-release`: `repo` as `owner/name`). Stored in the source's canonical form.
	Coordinates map[string]string `json:"coordinates"`

	// Id Generated when the watch is created; kept across updates. Equals `data.watch.id` in its events.
	Id Ulid `json:"id"`

	// Interval The requested check interval, `5m` to `720h`. Watches on one target share the smallest interval among them; `status.effective_interval` shows the one in use.
	Interval Duration `json:"interval"`

	// Labels String labels. At most 32; keys `^[A-Za-z0-9][A-Za-z0-9._/-]{0,62}$`, values at most 253 characters with no control characters.
	//
	// Examples: {"team":"platform"}
	Labels Labels `json:"labels"`

	// ManagedBy Who owns the resource. `api`: created through this API (or `angelia apply`). `file`:
	// created from a watch file loaded with `angelia serve --watches`; the API reads it but
	// refuses to change or delete it (`409 managed-by-file`).
	ManagedBy ManagedBy `json:"managed_by"`

	// Name The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).
	Name Name `json:"name"`

	// Policy Which new versions become events. Keys and semantics as in `watches[].policy` of the watch file.
	Policy WatchPolicy `json:"policy"`

	// Scheme The version scheme (`semver`, `pep440`, `calver`, `lexical`). Defaults by source kind.
	Scheme string `json:"scheme"`

	// Source A registered source kind (`GET /v1/plugins?interface=source`), or the name of a source instance configured on the server (`sources.<name>.kind`). Events of the watch carry the base kind in `data.source`.
	Source Kind `json:"source"`

	// Status Scheduling state of the watch and its target.
	Status WatchStatus `json:"status"`
}

Watch A watch as the server returns it: the write keys with every default filled in, plus response-only fields. Sending the write keys back with `PUT` changes nothing.

type WatchFilter

type WatchFilter = []NameOrId

WatchFilter defines model for WatchFilter.

type WatchName

type WatchName = Name

WatchName The stable key of a watch, sink, subscription, secret or consumer (the first three as in the watch file), or the label of an API token. Unique per resource type, whoever manages the resource (for tokens, among active tokens).

type WatchPage

type WatchPage struct {
	Items []Watch `json:"items"`

	// NextCursor The cursor of the next page, or `null` on the last page.
	NextCursor *NextCursor `json:"next_cursor"`
}

WatchPage defines model for WatchPage.

type WatchPolicy

type WatchPolicy struct {
	// Baseline When true, the versions known at the first check are recorded without events.
	Baseline *bool `json:"baseline,omitempty"`

	// Bump Keep only these bumps. Empty means all.
	Bump *[]Bump `json:"bump,omitempty"`

	// Constraint A version range such as `>=2 <3`, checked by the watch's scheme. Empty means any.
	Constraint *string `json:"constraint,omitempty"`

	// Cooldown Emit a version only once it is this old, and drop it if it is yanked in between. `0` to `8760h`; a negative value is an error.
	Cooldown *Duration `json:"cooldown,omitempty"`

	// Exclude RE2 regexes on the raw version; a match drops the version. Wins over `include`. At most 16.
	Exclude *[]string `json:"exclude,omitempty"`

	// Include RE2 regexes on the raw version; a version must match one. Empty means all. At most 16.
	Include *[]string `json:"include,omitempty"`

	// Prerelease `none`: drop pre-releases. `only`: keep only pre-releases. `include`: keep both.
	Prerelease *PrereleaseMode `json:"prerelease,omitempty"`
}

WatchPolicy Which new versions become events. Keys and semantics as in `watches[].policy` of the watch file.

type WatchStatus

type WatchStatus struct {
	// BaselineDone Whether the first check (the baseline) has run.
	BaselineDone bool `json:"baseline_done"`

	// EffectiveInterval The interval the target is checked at, the smallest `interval` among the watches that share it.
	EffectiveInterval Duration `json:"effective_interval"`

	// ErrorCount Consecutive failed checks of the target (drives the backoff).
	ErrorCount int `json:"error_count"`

	// LastCheckedAt The end of the last check of the target, or `null` before the first.
	LastCheckedAt *Timestamp `json:"last_checked_at"`

	// NextCheckAt When the target is next due, or `null` while unscheduled.
	NextCheckAt *Timestamp `json:"next_check_at"`
}

WatchStatus Scheduling state of the watch and its target.

type WatchWrite

type WatchWrite struct {
	// Coordinates Source-owned parameters that name the upstream object (`pypi`, `npm`, `crates`: `name`; `github-release`: `repo` as `owner/name`). Stored in the source's canonical form.
	Coordinates map[string]string `json:"coordinates"`

	// Interval The requested check interval, `5m` to `720h`. Watches on one target share the smallest interval among them; `status.effective_interval` shows the one in use.
	Interval *Duration `json:"interval,omitempty"`

	// Labels String labels. At most 32; keys `^[A-Za-z0-9][A-Za-z0-9._/-]{0,62}$`, values at most 253 characters with no control characters.
	//
	// Examples: {"team":"platform"}
	Labels *Labels `json:"labels,omitempty"`

	// Name Optional; when given it must equal the name in the path.
	Name *Name `json:"name,omitempty"`

	// Policy Which new versions become events. Keys and semantics as in `watches[].policy` of the watch file.
	Policy *WatchPolicy `json:"policy,omitempty"`

	// Scheme The version scheme (`semver`, `pep440`, `calver`, `lexical`). Defaults by source kind.
	Scheme *string `json:"scheme,omitempty"`

	// Source A registered source kind (`GET /v1/plugins?interface=source`), or the name of a source instance configured on the server (`sources.<name>.kind`). Events of the watch carry the base kind in `data.source`.
	Source Kind `json:"source"`
}

WatchWrite The body of `PUT /v1/watches/{name}`: the keys of `watches[]` in the watch file. Omitted optional keys take their defaults.

Jump to

Keyboard shortcuts

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