Documentation
¶
Overview ¶
Package server exposes an mqlite Engine as a Connect-style JSON-over-HTTP broker (design §7). Every unary RPC is a plain HTTP POST to /mqlite.v1.<Service>/<Method> with a JSON body — curl-able by construction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Version string // reported by the open "/" discovery endpoint; "" -> "dev"
CORS string // Access-Control-Allow-Origin to send; "" -> CORS off (see cors.go)
Logger *slog.Logger // per-request access log; nil -> no request logging (see logging.go)
UI bool // serve the embedded admin console at /ui (see console.go)
// MaxBodyBytes bounds any single RPC request body BEFORE JSON decoding
// (review F8): without it a multi-GB body OOMs the broker before the
// per-message MaxMessageBytes check ever runs. Bodies are base64 (x4/3) and
// a batched Send carries many messages, so the default (32 MiB) sits far
// above normal use while keeping one hostile request a fraction of the
// smallest supported deployment's RAM. Over the cap -> 413 message_too_large.
MaxBodyBytes int64
// contains filtered or unexported fields
}
Server adapts an Engine to HTTP with static Bearer-token auth.
Click to show internal directories.
Click to hide internal directories.