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
- Variables
- func CheckStoredSinks(ctx context.Context, st store.APIStore, plugins []PluginInfo) error
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func SinkDestinations(plugins []PluginInfo) (map[string]string, error)
- func SinkSecretDestinations(plugins []PluginInfo) (map[string][]string, error)
- type After
- type Authenticator
- type BadRequest
- type BadRequestApplicationProblemPlusJSONResponse
- type Bump
- type Change
- type ChiServerOptions
- type Conflict
- type ConflictApplicationProblemPlusJSONResponse
- type CreateReplayJSONRequestBody
- type CreateReplayRequestObject
- type CreateReplayResponseObject
- type Cursor
- type CursorExpired
- type CursorExpiredApplicationProblemPlusJSONResponse
- type DeleteSecretParams
- type DeleteSecretRequestObject
- type DeleteSecretResponseObject
- type DeleteSinkParams
- type DeleteSinkRequestObject
- type DeleteSinkResponseObject
- type DeleteSubscriptionParams
- type DeleteSubscriptionRequestObject
- type DeleteSubscriptionResponseObject
- type DeleteWatchParams
- type DeleteWatchRequestObject
- type DeleteWatchResponseObject
- type Delivery
- type DeliveryId
- type DeliveryPage
- type DeliveryStatus
- type DenyAll
- type DryRun
- type Duration
- type EventLimit
- type EventPage
- type EventRecord
- type Forbidden
- type ForbiddenApplicationProblemPlusJSONResponse
- type GetDeliveryRequestObject
- type GetDeliveryResponseObject
- type GetEventRequestObject
- type GetEventResponseObject
- type GetPluginRequestObject
- type GetPluginResponseObject
- type GetSecretRequestObject
- type GetSecretResponseObject
- type GetSinkRequestObject
- type GetSinkResponseObject
- type GetSubscriptionRequestObject
- type GetSubscriptionResponseObject
- type GetWatchRequestObject
- type GetWatchResponseObject
- type InternalError
- type InternalErrorApplicationProblemPlusJSONResponse
- type InvalidParamFormatError
- type Kind
- type LabelFilter
- type Labels
- type Limit
- type ListDeliveriesParams
- type ListDeliveriesRequestObject
- type ListDeliveriesResponseObject
- type ListEventsParams
- type ListEventsRequestObject
- type ListEventsResponseObject
- type ListPluginsParams
- type ListPluginsRequestObject
- type ListPluginsResponseObject
- type ListSecretsParams
- type ListSecretsRequestObject
- type ListSecretsResponseObject
- type ListSinksParams
- type ListSinksRequestObject
- type ListSinksResponseObject
- type ListSubscriptionsParams
- type ListSubscriptionsRequestObject
- type ListSubscriptionsResponseObject
- type ListWatchVersionsParams
- type ListWatchVersionsRequestObject
- type ListWatchVersionsResponseObject
- type ListWatchesParams
- type ListWatchesRequestObject
- type ListWatchesResponseObject
- type ManagedBy
- type MiddlewareFunc
- type Name
- type NameOrId
- type NextCursor
- type NotFound
- type NotFoundApplicationProblemPlusJSONResponse
- type Options
- type PayloadTooLarge
- type PayloadTooLargeApplicationProblemPlusJSONResponse
- type Plugin
- type PluginHost
- type PluginHostInfo
- type PluginHostOrigin
- type PluginInfo
- type PluginInterface
- type PluginPage
- type PrereleaseMode
- type Principal
- type Problem
- type ProblemDetail
- type ProblemDetailError
- type ProblemError
- type ProblemRequiredScope
- type PutSecretJSONRequestBody
- type PutSecretParams
- type PutSecretRequestObject
- type PutSecretResponseObject
- type PutSinkJSONRequestBody
- type PutSinkParams
- type PutSinkRequestObject
- type PutSinkResponseObject
- type PutSubscriptionJSONRequestBody
- type PutSubscriptionParams
- type PutSubscriptionRequestObject
- type PutSubscriptionResponseObject
- type PutWatchJSONRequestBody
- type PutWatchParams
- type PutWatchRequestObject
- type PutWatchResponseObject
- type ReplayDeliveryJSONBody
- type ReplayDeliveryJSONRequestBody
- type ReplayDeliveryRequestObject
- type ReplayDeliveryResponseObject
- type ReplayRequest
- func (t ReplayRequest) AsReplayRequest0() (ReplayRequest0, error)
- func (t ReplayRequest) AsReplayRequest1() (ReplayRequest1, error)
- func (t *ReplayRequest) FromReplayRequest0(v ReplayRequest0) error
- func (t *ReplayRequest) FromReplayRequest1(v ReplayRequest1) error
- func (t ReplayRequest) MarshalJSON() ([]byte, error)
- func (t *ReplayRequest) MergeReplayRequest0(v ReplayRequest0) error
- func (t *ReplayRequest) MergeReplayRequest1(v ReplayRequest1) error
- func (t *ReplayRequest) UnmarshalJSON(b []byte) error
- type ReplayRequest0
- type ReplayRequest1
- type ReplayRequestStatus
- type ReplayResult
- type RequiredHeaderError
- type RequiredParamError
- type Scope
- type Secret
- type SecretName
- type SecretPage
- type SecretReferrer
- type SecretReferrerResource
- type SecretWrite
- func (t SecretWrite) AsSecretWrite0() (SecretWrite0, error)
- func (t SecretWrite) AsSecretWrite1() (SecretWrite1, error)
- func (t *SecretWrite) FromSecretWrite0(v SecretWrite0) error
- func (t *SecretWrite) FromSecretWrite1(v SecretWrite1) error
- func (t SecretWrite) MarshalJSON() ([]byte, error)
- func (t *SecretWrite) MergeSecretWrite0(v SecretWrite0) error
- func (t *SecretWrite) MergeSecretWrite1(v SecretWrite1) error
- func (t *SecretWrite) UnmarshalJSON(b []byte) error
- type SecretWrite0
- type SecretWrite1
- type Seq
- type Server
- func (s *Server) CheckStoredSinks(ctx context.Context) error
- func (s *Server) CreateReplay(ctx context.Context, _ CreateReplayRequestObject) (CreateReplayResponseObject, error)
- func (s *Server) DeleteSecret(ctx context.Context, req DeleteSecretRequestObject) (DeleteSecretResponseObject, error)
- func (s *Server) DeleteSink(ctx context.Context, req DeleteSinkRequestObject) (DeleteSinkResponseObject, error)
- func (s *Server) DeleteSubscription(ctx context.Context, req DeleteSubscriptionRequestObject) (DeleteSubscriptionResponseObject, error)
- func (s *Server) DeleteWatch(ctx context.Context, req DeleteWatchRequestObject) (DeleteWatchResponseObject, error)
- func (s *Server) Drain()
- func (s *Server) GetDelivery(ctx context.Context, req GetDeliveryRequestObject) (GetDeliveryResponseObject, error)
- func (s *Server) GetEvent(ctx context.Context, req GetEventRequestObject) (GetEventResponseObject, error)
- func (s *Server) GetPlugin(_ context.Context, req GetPluginRequestObject) (GetPluginResponseObject, error)
- func (s *Server) GetSecret(ctx context.Context, req GetSecretRequestObject) (GetSecretResponseObject, error)
- func (s *Server) GetSink(ctx context.Context, req GetSinkRequestObject) (GetSinkResponseObject, error)
- func (s *Server) GetSubscription(ctx context.Context, req GetSubscriptionRequestObject) (GetSubscriptionResponseObject, error)
- func (s *Server) GetWatch(ctx context.Context, req GetWatchRequestObject) (GetWatchResponseObject, error)
- func (s *Server) ListDeliveries(ctx context.Context, req ListDeliveriesRequestObject) (ListDeliveriesResponseObject, error)
- func (s *Server) ListEvents(ctx context.Context, req ListEventsRequestObject) (ListEventsResponseObject, error)
- func (s *Server) ListPlugins(_ context.Context, req ListPluginsRequestObject) (ListPluginsResponseObject, error)
- func (s *Server) ListSecrets(ctx context.Context, req ListSecretsRequestObject) (ListSecretsResponseObject, error)
- func (s *Server) ListSinks(ctx context.Context, req ListSinksRequestObject) (ListSinksResponseObject, error)
- func (s *Server) ListSubscriptions(ctx context.Context, req ListSubscriptionsRequestObject) (ListSubscriptionsResponseObject, error)
- func (s *Server) ListWatchVersions(ctx context.Context, req ListWatchVersionsRequestObject) (ListWatchVersionsResponseObject, error)
- func (s *Server) ListWatches(ctx context.Context, req ListWatchesRequestObject) (ListWatchesResponseObject, error)
- func (s *Server) PutSecret(ctx context.Context, req PutSecretRequestObject) (PutSecretResponseObject, error)
- func (s *Server) PutSink(ctx context.Context, req PutSinkRequestObject) (PutSinkResponseObject, error)
- func (s *Server) PutSubscription(ctx context.Context, req PutSubscriptionRequestObject) (PutSubscriptionResponseObject, error)
- func (s *Server) PutWatch(ctx context.Context, req PutWatchRequestObject) (PutWatchResponseObject, error)
- func (s *Server) ReplayDelivery(ctx context.Context, req ReplayDeliveryRequestObject) (ReplayDeliveryResponseObject, error)
- func (s *Server) Role() supervisor.Role
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) StreamEvents(ctx context.Context, req StreamEventsRequestObject) (StreamEventsResponseObject, error)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateReplay(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteSecret(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteSink(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteWatch(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetDelivery(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetEvent(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetPlugin(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSecret(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSink(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWatch(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListDeliveries(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListEvents(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListPlugins(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListSecrets(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListSinks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListSubscriptions(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListWatchVersions(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListWatches(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutSecret(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutSink(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutSubscription(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutWatch(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ReplayDelivery(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request)
- type ShortEventType
- type Sink
- type SinkConfig
- type SinkName
- type SinkPage
- type SinkWrite
- type SourceFilter
- type StreamEventsParams
- type StreamEventsRequestObject
- type StreamEventsResponseObject
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Subscription
- type SubscriptionFilter
- type SubscriptionName
- type SubscriptionPage
- type SubscriptionPolicy
- type SubscriptionWrite
- type Timestamp
- type TooManyValuesForParamError
- type TypeFilter
- type Ulid
- type Unauthorized
- type UnauthorizedApplicationProblemPlusJSONResponse
- type UnauthorizedResponseHeaders
- type Unavailable
- type UnavailableApplicationProblemPlusJSONResponse
- type UnavailableResponseHeaders
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) CreateReplay(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeleteSecret(w http.ResponseWriter, r *http.Request, name SecretName, ...)
- func (_ Unimplemented) DeleteSink(w http.ResponseWriter, r *http.Request, name SinkName, params DeleteSinkParams)
- func (_ Unimplemented) DeleteSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName, ...)
- func (_ Unimplemented) DeleteWatch(w http.ResponseWriter, r *http.Request, name WatchName, ...)
- func (_ Unimplemented) GetDelivery(w http.ResponseWriter, r *http.Request, id DeliveryId)
- func (_ Unimplemented) GetEvent(w http.ResponseWriter, r *http.Request, id Ulid)
- func (_ Unimplemented) GetPlugin(w http.ResponseWriter, r *http.Request, pInterface PluginInterface, kind Kind)
- func (_ Unimplemented) GetSecret(w http.ResponseWriter, r *http.Request, name SecretName)
- func (_ Unimplemented) GetSink(w http.ResponseWriter, r *http.Request, name SinkName)
- func (_ Unimplemented) GetSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName)
- func (_ Unimplemented) GetWatch(w http.ResponseWriter, r *http.Request, name WatchName)
- func (_ Unimplemented) ListDeliveries(w http.ResponseWriter, r *http.Request, params ListDeliveriesParams)
- func (_ Unimplemented) ListEvents(w http.ResponseWriter, r *http.Request, params ListEventsParams)
- func (_ Unimplemented) ListPlugins(w http.ResponseWriter, r *http.Request, params ListPluginsParams)
- func (_ Unimplemented) ListSecrets(w http.ResponseWriter, r *http.Request, params ListSecretsParams)
- func (_ Unimplemented) ListSinks(w http.ResponseWriter, r *http.Request, params ListSinksParams)
- func (_ Unimplemented) ListSubscriptions(w http.ResponseWriter, r *http.Request, params ListSubscriptionsParams)
- func (_ Unimplemented) ListWatchVersions(w http.ResponseWriter, r *http.Request, name WatchName, ...)
- func (_ Unimplemented) ListWatches(w http.ResponseWriter, r *http.Request, params ListWatchesParams)
- func (_ Unimplemented) PutSecret(w http.ResponseWriter, r *http.Request, name SecretName, ...)
- func (_ Unimplemented) PutSink(w http.ResponseWriter, r *http.Request, name SinkName, params PutSinkParams)
- func (_ Unimplemented) PutSubscription(w http.ResponseWriter, r *http.Request, name SubscriptionName, ...)
- func (_ Unimplemented) PutWatch(w http.ResponseWriter, r *http.Request, name WatchName, params PutWatchParams)
- func (_ Unimplemented) ReplayDelivery(w http.ResponseWriter, r *http.Request, id DeliveryId)
- func (_ Unimplemented) StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)
- type UnmarshalingParamError
- type UnsupportedMediaType
- type UnsupportedMediaTypeApplicationProblemPlusJSONResponse
- type ValidationFailed
- type ValidationFailedApplicationProblemPlusJSONResponse
- type Version
- type VersionPage
- type Watch
- type WatchFilter
- type WatchName
- type WatchPage
- type WatchPolicy
- type WatchStatus
- type WatchWrite
Constants ¶
const ( SlugBadRequest = "bad-request" 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" )
Problem slugs (spec docs/api.md, "Problem types").
const ( DefaultStreamPoll = time.Second DefaultKeepAlive = 15 * time.Second MaxAuthRecheck = 60 * time.Second DefaultEventScan = 10000 // 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).
const Masked = "[REDACTED]"
Masked is the value of a configuration key the kind marks secret.
const MaxBodyBytes = 1 << 20
MaxBodyBytes is the largest request body accepted (spec docs/api.md decision 21); larger bodies get 413 payload-too-large.
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.
const RetryAfterSeconds = 5
RetryAfterSeconds is the Retry-After of a 503 while the instance drains.
Variables ¶
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 CheckStoredSinks ¶
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 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 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 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. Token storage, hashing and revocation belong to the API tokens story (#72); 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 Change ¶
type Change string
Change is the value of the Angelia-Change header (spec docs/api.md decision 6).
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 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 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 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 is the Authenticator `angelia serve` uses until API tokens (#72) exist: it accepts no token, so every API request gets 401.
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 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 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 GetWatchRequestObject ¶
type GetWatchRequestObject struct {
Name WatchName `json:"name"`
}
type GetWatchResponseObject ¶
type GetWatchResponseObject interface {
VisitGetWatchResponse(w http.ResponseWriter) error
}
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 ¶
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 Labels ¶
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 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 source kinds.
Source *SourceFilter `form:"source,omitempty" json:"source,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 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 source kinds.
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 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`).
type Name ¶
type Name = string
Name The stable key of a watch, sink or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 DenyAll until API
// tokens (#72) exist.
Auth Authenticator
// 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
}
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
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 ¶
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 ( Admin ProblemRequiredScope = "admin" Read ProblemRequiredScope = "read" Write 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 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 ¶
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 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).
The scopes, in order. ScopeNone is no scope at all.
func ParseScope ¶
ParseScope reads "read", "write" or "admin".
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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 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.
func (*Server) CheckStoredSinks ¶
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 ¶
func (s *Server) CreateReplay(ctx context.Context, _ CreateReplayRequestObject) (CreateReplayResponseObject, error)
CreateReplay implements StrictServerInterface.
func (*Server) DeleteSecret ¶
func (s *Server) DeleteSecret(ctx context.Context, req DeleteSecretRequestObject) (DeleteSecretResponseObject, error)
DeleteSecret implements StrictServerInterface.
func (*Server) DeleteSink ¶
func (s *Server) DeleteSink(ctx context.Context, req DeleteSinkRequestObject) (DeleteSinkResponseObject, error)
DeleteSink implements StrictServerInterface.
func (*Server) DeleteSubscription ¶
func (s *Server) DeleteSubscription(ctx context.Context, req DeleteSubscriptionRequestObject) (DeleteSubscriptionResponseObject, error)
DeleteSubscription implements StrictServerInterface.
func (*Server) DeleteWatch ¶
func (s *Server) DeleteWatch(ctx context.Context, req DeleteWatchRequestObject) (DeleteWatchResponseObject, error)
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) GetDelivery ¶
func (s *Server) GetDelivery(ctx context.Context, req GetDeliveryRequestObject) (GetDeliveryResponseObject, error)
GetDelivery implements StrictServerInterface.
func (*Server) GetEvent ¶
func (s *Server) GetEvent(ctx context.Context, req GetEventRequestObject) (GetEventResponseObject, error)
GetEvent implements StrictServerInterface.
func (*Server) GetPlugin ¶
func (s *Server) GetPlugin(_ context.Context, req GetPluginRequestObject) (GetPluginResponseObject, error)
GetPlugin implements StrictServerInterface.
func (*Server) GetSecret ¶
func (s *Server) GetSecret(ctx context.Context, req GetSecretRequestObject) (GetSecretResponseObject, error)
GetSecret implements StrictServerInterface.
func (*Server) GetSink ¶
func (s *Server) GetSink(ctx context.Context, req GetSinkRequestObject) (GetSinkResponseObject, error)
GetSink implements StrictServerInterface.
func (*Server) GetSubscription ¶
func (s *Server) GetSubscription(ctx context.Context, req GetSubscriptionRequestObject) (GetSubscriptionResponseObject, error)
GetSubscription implements StrictServerInterface.
func (*Server) GetWatch ¶
func (s *Server) GetWatch(ctx context.Context, req GetWatchRequestObject) (GetWatchResponseObject, error)
GetWatch implements StrictServerInterface.
func (*Server) ListDeliveries ¶
func (s *Server) ListDeliveries(ctx context.Context, req ListDeliveriesRequestObject) (ListDeliveriesResponseObject, error)
ListDeliveries implements StrictServerInterface.
func (*Server) ListEvents ¶
func (s *Server) ListEvents(ctx context.Context, req ListEventsRequestObject) (ListEventsResponseObject, error)
ListEvents implements StrictServerInterface.
func (*Server) ListPlugins ¶
func (s *Server) ListPlugins(_ context.Context, req ListPluginsRequestObject) (ListPluginsResponseObject, error)
ListPlugins implements StrictServerInterface.
func (*Server) ListSecrets ¶
func (s *Server) ListSecrets(ctx context.Context, req ListSecretsRequestObject) (ListSecretsResponseObject, error)
ListSecrets implements StrictServerInterface.
func (*Server) ListSinks ¶
func (s *Server) ListSinks(ctx context.Context, req ListSinksRequestObject) (ListSinksResponseObject, error)
ListSinks implements StrictServerInterface.
func (*Server) ListSubscriptions ¶
func (s *Server) ListSubscriptions(ctx context.Context, req ListSubscriptionsRequestObject) (ListSubscriptionsResponseObject, error)
ListSubscriptions implements StrictServerInterface.
func (*Server) ListWatchVersions ¶
func (s *Server) ListWatchVersions(ctx context.Context, req ListWatchVersionsRequestObject) (ListWatchVersionsResponseObject, error)
ListWatchVersions implements StrictServerInterface.
func (*Server) ListWatches ¶
func (s *Server) ListWatches(ctx context.Context, req ListWatchesRequestObject) (ListWatchesResponseObject, error)
ListWatches implements StrictServerInterface.
func (*Server) PutSecret ¶
func (s *Server) PutSecret(ctx context.Context, req PutSecretRequestObject) (PutSecretResponseObject, error)
PutSecret implements StrictServerInterface.
func (*Server) PutSink ¶
func (s *Server) PutSink(ctx context.Context, req PutSinkRequestObject) (PutSinkResponseObject, error)
PutSink implements StrictServerInterface.
func (*Server) PutSubscription ¶
func (s *Server) PutSubscription(ctx context.Context, req PutSubscriptionRequestObject) (PutSubscriptionResponseObject, error)
PutSubscription implements StrictServerInterface.
func (*Server) PutWatch ¶
func (s *Server) PutWatch(ctx context.Context, req PutWatchRequestObject) (PutWatchResponseObject, error)
PutWatch implements StrictServerInterface.
func (*Server) ReplayDelivery ¶
func (s *Server) ReplayDelivery(ctx context.Context, req ReplayDeliveryRequestObject) (ReplayDeliveryResponseObject, error)
ReplayDelivery implements StrictServerInterface. The replay keeps attempts and starts a new retry budget (store.Delivery.ReplayBaseAttempts, spec docs/api.md decision 28).
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, 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.
func (*Server) StreamEvents ¶
func (s *Server) StreamEvents(ctx context.Context, req StreamEventsRequestObject) (StreamEventsResponseObject, error)
StreamEvents implements StrictServerInterface: GET /v1/events/stream as server-sent events (spec docs/api.md decision 15).
type ServerInterface ¶
type ServerInterface interface {
// 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)
// 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) CreateReplay ¶
func (siw *ServerInterfaceWrapper) CreateReplay(w http.ResponseWriter, r *http.Request)
CreateReplay 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) 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 ¶
func (siw *ServerInterfaceWrapper) GetSink(w http.ResponseWriter, r *http.Request)
GetSink operation middleware
func (*ServerInterfaceWrapper) GetSubscription ¶
func (siw *ServerInterfaceWrapper) GetSubscription(w http.ResponseWriter, r *http.Request)
GetSubscription operation middleware
func (*ServerInterfaceWrapper) GetWatch ¶
func (siw *ServerInterfaceWrapper) GetWatch(w http.ResponseWriter, r *http.Request)
GetWatch 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) 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) PutSecret ¶
func (siw *ServerInterfaceWrapper) PutSecret(w http.ResponseWriter, r *http.Request)
PutSecret operation middleware
func (*ServerInterfaceWrapper) PutSink ¶
func (siw *ServerInterfaceWrapper) PutSink(w http.ResponseWriter, r *http.Request)
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) 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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 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 source kinds.
Source *SourceFilter `form:"source,omitempty" json:"source,omitempty"`
// LastEventID The `seq` of the last event the client received. Takes precedence over `after`.
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 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 StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// 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)
// 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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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 ¶
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 TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
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 {
}
type UnauthorizedResponseHeaders ¶
type UnauthorizedResponseHeaders struct {
}
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 {
}
type UnavailableResponseHeaders ¶
type UnavailableResponseHeaders struct {
}
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreateReplay ¶
func (_ Unimplemented) CreateReplay(w http.ResponseWriter, r *http.Request)
CreateReplay Replay deliveries in bulk (POST /v1/replays)
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) 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) GetWatch ¶
func (_ Unimplemented) GetWatch(w http.ResponseWriter, r *http.Request, name WatchName)
GetWatch Get a watch (GET /v1/watches/{name})
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) 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) 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) StreamEvents ¶
func (_ Unimplemented) StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)
StreamEvents Stream events (server-sent events) (GET /v1/events/stream)
type UnmarshalingParamError ¶
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 or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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`).
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 WatchName ¶
type WatchName = Name
WatchName The stable key of a watch, sink or subscription, as in the watch file. Unique per resource type, whoever manages the resource.
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`).
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.