Documentation
¶
Index ¶
- Constants
- func ConfigurationSchema() (spiceconfig.Schema, error)
- func Main(arguments []string) int
- func RunCommand(options CommandOptions) int
- type Application
- func (application *Application) Components() Components
- func (application *Application) Handler() http.Handler
- func (application *Application) RegisterObserver(observer spicelifecycle.Observer) error
- func (application *Application) Run(ctx context.Context, shutdown spicelifecycle.ContextFactory) error
- func (application *Application) ShutdownTimeout() time.Duration
- func (application *Application) Start(ctx context.Context) error
- func (application *Application) State() spicelifecycle.State
- func (application *Application) Stop(ctx context.Context) error
- type ApplicationOptions
- type BeanOverrideLayer
- type BeanOverrides
- type CommandOptions
- type Components
- type RouteInterceptors
- type ShutdownContextFactory
Constants ¶
const ( ExitSuccess = 0 ExitFailure = 1 ExitUsage = 2 )
const TargetID = spiceentrypoint.ApplicationTargetPostgres_510ed9a8
Variables ¶
This section is empty.
Functions ¶
func ConfigurationSchema ¶
func ConfigurationSchema() (spiceconfig.Schema, error)
func RunCommand ¶
func RunCommand(options CommandOptions) int
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(ctx context.Context, observers ...spicelifecycle.Observer) (*Application, error)
func NewApplicationWithOptions ¶
func NewApplicationWithOptions(ctx context.Context, options ApplicationOptions) (*Application, error)
func (*Application) Components ¶
func (application *Application) Components() Components
Components returns a typed snapshot of constructed singleton beans.
func (*Application) Handler ¶
func (application *Application) Handler() http.Handler
func (*Application) RegisterObserver ¶
func (application *Application) RegisterObserver(observer spicelifecycle.Observer) error
func (*Application) Run ¶
func (application *Application) Run(ctx context.Context, shutdown spicelifecycle.ContextFactory) error
func (*Application) ShutdownTimeout ¶
func (application *Application) ShutdownTimeout() time.Duration
func (*Application) State ¶
func (application *Application) State() spicelifecycle.State
type ApplicationOptions ¶
type ApplicationOptions struct {
Overrides BeanOverrides
Profiles []string
Sources []spiceconfig.Source
AllowUnknownConfiguration bool
ErrorMapper spiceweb.ErrorMapper
MaxRequestBodyBytes int64
HTTPObservers []spiceweb.HTTPObserver
Middleware []spiceweb.Middleware
Interceptors RouteInterceptors
Logger *slog.Logger
Observers []spicelifecycle.Observer
}
type BeanOverrideLayer ¶
type BeanOverrideLayer struct {
Name string
Overrides BeanOverrides
}
BeanOverrideLayer is one named immutable override composition layer. Layers are applied in order; a later layer deliberately replaces an earlier value.
type BeanOverrides ¶
type BeanOverrides struct {
// Catalog replaces bean "newCatalog".
Catalog spicebean.Override[*i18n.Catalog]
// Renderer replaces bean "newRenderer".
Renderer spicebean.Override[*spiceview.Renderer]
// Mux replaces bean "newMux".
Mux spicebean.Override[*http.ServeMux]
// WelcomeController replaces bean "welcomeController".
WelcomeController spicebean.Override[*system.WelcomeController]
// OpenDatabase replaces bean "openDatabase".
OpenDatabase spicebean.Override[*postgres.Database]
// VetRepository replaces bean "vetRepository".
VetRepository spicebean.Override[*postgres.VetRepository]
// VetController replaces bean "controller".
VetController spicebean.Override[*vet.Controller]
// OwnerRepository replaces bean "ownerRepository".
OwnerRepository spicebean.Override[*postgres.OwnerRepository]
// OwnerController replaces bean "controller".
OwnerController spicebean.Override[*owner.Controller]
// VisitController replaces bean "visitController".
VisitController spicebean.Override[*owner.VisitController]
// PetTypeRepository replaces bean "petTypeRepository".
PetTypeRepository spicebean.Override[*postgres.PetTypeRepository]
// PetController replaces bean "petController".
PetController spicebean.Override[*owner.PetController]
// Server replaces bean "newServer".
Server spicebean.Override[*presentation.Server]
}
BeanOverrides provides compile-time-typed singleton replacements. Replacements use the normal generated cleanup and rollback path.
func ComposeBeanOverrides ¶
func ComposeBeanOverrides(layers ...BeanOverrideLayer) (BeanOverrides, error)
ComposeBeanOverrides validates and deterministically composes named layers. It never mutates a running application or performs runtime bean lookup.
type CommandOptions ¶
type Components ¶
type Components struct {
// Catalog is bean "newCatalog".
Catalog *i18n.Catalog
// Renderer is bean "newRenderer".
Renderer *spiceview.Renderer
// Mux is bean "newMux".
Mux *http.ServeMux
// WelcomeController is bean "welcomeController".
WelcomeController *system.WelcomeController
// Settings is bean "Settings".
Settings postgres.Settings
// OpenDatabase is bean "openDatabase".
OpenDatabase *postgres.Database
// VetRepository is bean "vetRepository".
VetRepository *postgres.VetRepository
// VetController is bean "controller".
VetController *vet.Controller
// OwnerRepository is bean "ownerRepository".
OwnerRepository *postgres.OwnerRepository
// OwnerController is bean "controller".
OwnerController *owner.Controller
// VisitController is bean "visitController".
VisitController *owner.VisitController
// PetTypeRepository is bean "petTypeRepository".
PetTypeRepository *postgres.PetTypeRepository
// PetController is bean "petController".
PetController *owner.PetController
// ServerSettings is bean "ServerSettings".
ServerSettings presentation.ServerSettings
// Server is bean "newServer".
Server *presentation.Server
}
Components is a typed snapshot of constructed singleton beans. It performs no reflection or string-based lookup.
type RouteInterceptors ¶
type RouteInterceptors struct {
ControllerListJSON []spiceintercept.Interceptor[vet.AllRequest, vet.Vets]
ControllerListHTML []spiceintercept.Interceptor[vet.ListRequest, spiceview.Result]
ControllerFind []spiceintercept.Interceptor[owner.FindOwnersRequest, spiceview.Result]
ControllerFindForm []spiceintercept.Interceptor[owner.FindOwnerFormRequest, spiceview.Result]
ControllerNewForm []spiceintercept.Interceptor[owner.NewOwnerRequest, spiceview.Result]
ControllerShow []spiceintercept.Interceptor[owner.OwnerIDRequest, spiceview.Result]
ControllerEditForm []spiceintercept.Interceptor[owner.OwnerIDRequest, spiceview.Result]
PetControllerNewForm []spiceintercept.Interceptor[owner.NewPetRequest, spiceview.Result]
PetControllerEditForm []spiceintercept.Interceptor[owner.OwnerPetRequest, spiceview.Result]
VisitControllerNewForm []spiceintercept.Interceptor[owner.NewVisitRequest, spiceview.Result]
WelcomeControllerShow []spiceintercept.Interceptor[system.WelcomeRequest, spiceview.Result]
}
RouteInterceptors configures typed generated route method decorators. The first interceptor in each field is the outermost invocation.
type ShutdownContextFactory ¶
Source Files
¶
- spice_assembly_gen.go
- spice_command_gen.go
- spice_configuration_gen.go
- spice_contracts_gen.go
- spice_features_gen.go
- spice_http_gen.go
- spice_http_route_owner_controller_create_e8591fe8fd97_gen.go
- spice_http_route_owner_controller_editform_34933d559ead_gen.go
- spice_http_route_owner_controller_find_2cd5c768b022_gen.go
- spice_http_route_owner_controller_findform_554d4e3ad1ce_gen.go
- spice_http_route_owner_controller_newform_e4501169f930_gen.go
- spice_http_route_owner_controller_show_8423e9338b2a_gen.go
- spice_http_route_owner_controller_update_9ba33272369f_gen.go
- spice_http_route_owner_petcontroller_create_8c47f4bf93bc_gen.go
- spice_http_route_owner_petcontroller_editform_cd4d645a1542_gen.go
- spice_http_route_owner_petcontroller_newform_30d451cf3be8_gen.go
- spice_http_route_owner_petcontroller_update_53ee21b419da_gen.go
- spice_http_route_owner_visitcontroller_create_f62250e8c3e4_gen.go
- spice_http_route_owner_visitcontroller_newform_d5f9687df7d9_gen.go
- spice_http_route_system_welcomecontroller_show_51a573a34f22_gen.go
- spice_http_route_vet_controller_listhtml_4eb815481251_gen.go
- spice_http_route_vet_controller_listjson_bbf7ac053051_gen.go
- spice_lifecycle_gen.go
- spice_providers_gen.go