Documentation
¶
Overview ¶
Package api serves the Keyway HTTP API (PRD §12) and the embedded web dashboard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP transport. It owns only transport concerns (routing, auth, idempotency, the node-local run index) and delegates all business logic to the application layer (app.Deps). Idempotency storage is the coordination seam, so a multi-replica deployment shares replays via Postgres; the in-flight lock is a same-node coalescing concern.
func NewServer ¶
NewServer constructs an API server over the application-layer dependencies, defaulting to an in-memory idempotency store. Use WithIdempotency to supply a shared (Postgres-backed) store for multi-replica deployments.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server and shuts down on ctx cancellation.
func (*Server) WithIdempotency ¶
func (s *Server) WithIdempotency(store coordination.IdempotencyStore) *Server
WithIdempotency overrides the idempotency store (e.g. the Postgres-backed one from the coordinator) so retried writes replay across replicas. Returns the server for chaining.