Documentation
¶
Overview ¶
Package server wires the sprite store behind a net/http router that speaks the Sprites REST surface over the /v1 path space. It uses Go 1.22+ method+pattern routing so it needs no third-party router, and is wire-compatible with chant's in-process Sprites fake.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
ErrorResponse is the JSON body spritzer returns for any non-2xx status. It carries an "error" message and a machine-readable status.
type Options ¶
type Options struct {
Version string
Clock clock.Clock
Logger *slog.Logger
// Runtime, when set, is container exec mode: sprites are containers and
// exec runs real commands (see real.go). Nil is the scripted interpreter.
Runtime runtime.Backend
// URLDomain, in container mode, also serves each sprite's URL at
// <name>.<URLDomain> (for example "localhost", giving
// http://box.localhost:4290). The path form /s/<name> always works.
URLDomain string
}
Options configures a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the spritzer state and serves the API.