Documentation
¶
Overview ¶
Package module defines the contract Vigil modules implement and the Registry used by cmd/server to compose them.
Each module under modules/* provides a constructor returning Module and is registered in cmd/server/main.go before Registry.MountAll mounts all routes on the shared mux.
Module-specific dependencies that aren't shared across modules (e.g. admin's start time and version, auth's provider config) are passed to the module constructor, not added to Dependencies. The shared Dependencies struct is kept deliberately minimal — every field added forces every module to deal with it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
Dependencies contains shared module dependencies.
type DevSeeder ¶
type DevSeeder interface {
DevSeed(ctx context.Context, deps Dependencies) error
}
DevSeeder is an optional module interface for development data seeding.
type Middleware ¶
Middleware is a route middleware function.
type Module ¶
type Module interface {
Name() string
Register(deps Dependencies, registrar *Registrar) error
}
Module is the explicit contract for feature modules.
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
func NewRegistrar ¶
func (*Registrar) Guarded ¶
func (r *Registrar) Guarded(pattern string, p Policy, h http.HandlerFunc, extra ...Middleware)
Guarded always applies policy middleware to the route.
func (*Registrar) Public ¶
func (r *Registrar) Public(pattern string, h http.HandlerFunc, extra ...Middleware)
Public intentionally omits policy middleware.