type

EndpointContext

type EndpointContext struct { Writer http.ResponseWriter Request *http.Request // RequestID is the framework request ID also returned in X-Request-ID. RequestID string // ClientIP is resolved through the configured trusted-proxy policy. ClientIP string // RouteParams contains decoded named path parameters. RouteParams map[string]string // Collection identifies the owning collection endpoint, when applicable. Collection schema.CollectionSlug // Global identifies the owning global endpoint, when applicable. Global schema.CollectionSlug // Actor is the authenticated user, or nil for an anonymous request. Actor *store.Document // ActorCollection identifies the auth collection that owns Actor. ActorCollection schema.CollectionSlug // Local enters the same access-controlled operation engine as REST and the // generated SDK. Local *LocalAPI // AdmitAuthAttempt applies the distributed authentication-attempt policy for // endpoints implementing an authentication flow. AdmitAuthAttempt func(context.Context, string, string) error // ReportError records a stable code and sends trusted detail to // HandlerOptions.RequestError without exposing it to the client. ReportError func(error, string) }

Raw HTTP, route parameters, verified actor identity, and LocalAPI supplied to a custom endpoint.

Source core/endpoint.go:38

@param Writer
Receives the endpoint response.
@param Request
Carries request body, headers, cancellation, and PathValue parameters.
@param RequestID
Matches the X-Request-ID response header.
@param ClientIP
Framework-resolved direct or trusted-forwarded client address.
@param RouteParams
Decoded named path parameters.
@param Collection
Owning collection when collection-scoped.
@param Global
Owning global when global-scoped.
@param Actor
Authenticated actor or nil for an anonymous request.
@param ActorCollection
Auth collection owning Actor.
@param Local
Enters the access-controlled operation engine.
@param AdmitAuthAttempt
Applies distributed auth-attempt admission.
@param ReportError
Records a stable observation code and trusted diagnostic detail.

Related types

  • Collection

    Executable authoring configuration for one document collection.

  • CollectionSlug

    A validated collection or global slug.

  • Global

    Executable authoring configuration for one singleton document.

  • Document

    A stored document with status and version metadata.

  • LocalAPI

    In-process content operations that share the REST authorization and lifecycle pipeline.