Documentation
¶
Overview ¶
Package server wires the HTTP handlers of braid-server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
Option customises New.
func WithAvatarFetch ¶
func WithAvatarFetch(f api.AvatarFetch) Option
WithAvatarFetch replaces the fetcher behind /api/v1/me/avatar (tests serve a picture without a TLS IdP).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server owns the DB pool and the route table.
func (*Server) Close ¶
func (s *Server) Close()
Close stops the live hub (connections close with 1001) and releases the DB pool.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api serves the /api/v1 endpoints used by the web app.
|
Package api serves the /api/v1 endpoints used by the web app. |
|
Package config parses the server's BRAID_* environment.
|
Package config parses the server's BRAID_* environment. |
|
Package db wraps the Postgres pool, per-request user scoping and migrations.
|
Package db wraps the Postgres pool, per-request user scoping and migrations. |
|
Package derive turns raw transcript rows into the derived tables, exactly once per row.
|
Package derive turns raw transcript rows into the derived tables, exactly once per row. |
|
derivetest
Package derivetest is test support for the derive engine: it stores raw data as ingest would and inspects the derived tables.
|
Package derivetest is test support for the derive engine: it stores raw data as ingest would and inspects the derived tables. |
|
parse
Package parse turns raw transcript lines and snapshots into typed events, leniently and without I/O.
|
Package parse turns raw transcript lines and snapshots into typed events, leniently and without I/O. |
|
Package device implements the RFC 8628 device authorization flow and its /device pages.
|
Package device implements the RFC 8628 device authorization flow and its /device pages. |
|
Package httpx holds shared HTTP building blocks for the server.
|
Package httpx holds shared HTTP building blocks for the server. |
|
Package ingest serves the device-authenticated data path: POST /v1/ingest and GET /v1/files.
|
Package ingest serves the device-authenticated data path: POST /v1/ingest and GET /v1/files. |
|
Package live fans per-user events from Postgres NOTIFY out to WebSocket clients.
|
Package live fans per-user events from Postgres NOTIFY out to WebSocket clients. |
|
Package servertest starts a complete braid-server against a fresh test database and a mock OIDC provider.
|
Package servertest starts a complete braid-server against a fresh test database and a mock OIDC provider. |
|
Package spa serves the embedded single-page web app.
|
Package spa serves the embedded single-page web app. |
|
Package stats serves the /api/v1/stats endpoints: aggregates over the derived tables of the signed-in user.
|
Package stats serves the /api/v1/stats endpoints: aggregates over the derived tables of the signed-in user. |
|
Package webauth implements OIDC web login (authorization code + PKCE) and DB-backed sessions.
|
Package webauth implements OIDC web login (authorization code + PKCE) and DB-backed sessions. |
|
oidctest
Package oidctest is a minimal in-process OIDC provider for tests.
|
Package oidctest is a minimal in-process OIDC provider for tests. |