Documentation
¶
Overview ¶
Package servicefixture is the HTTP service the service-integration tests run: an application with a route of its own that mounts the MCP handler behind the estate transport and a transit chain, under one controls controller, the way spec 0001 D7 requires of a real service. It is evidence for that shape, not an example to copy into a consumer.
Index ¶
Constants ¶
const ( ReaderKey = "reader-key" WriterKey = "writer-key" KeyHeader = "X-API-Key" Path = "/mcp" AppPath = "/app/whoami" )
The two API keys the service accepts, and the subjects they establish.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Logger *slog.Logger
ShutdownBudget time.Duration
BodyLimit int64
TrustedOrigins []string
// Middleware follows authentication in the chain, so a test can break the
// response stream from where a real middleware would.
Middleware []transithttp.Middleware
}
Options configure one service instance. Zero values take the defaults a service would: the transport's body limit and a five-second shutdown budget.
type Service ¶
type Service struct {
Controller *controls.Controller
MCP *server.Server
Addr string
Records atomic.Int64
Entered chan struct{}
Ended chan error
}
Service is one running instance. Records counts fixture.record executions; Entered and Ended observe each fixture.wait from outside.