Documentation
¶
Overview ¶
Package boot owns application startup wiring.
Index ¶
- func Run(configPath string, opts ...Option) error
- type App
- type Context
- type Module
- type ModuleOption
- type Option
- type Resources
- func (r *Resources) Close(ctx context.Context) error
- func (r *Resources) MongoDB() (*mongo.Client, bool)
- func (r *Resources) MySQL() (*gorm.DB, bool)
- func (r *Resources) Ready(ctx context.Context) error
- func (r *Resources) Redis() (*goredis.Client, bool)
- func (r *Resources) Shutdown(ctx context.Context) error
- func (r *Resources) Status(ctx context.Context) []server.CapabilityStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the assembled application runtime.
type Context ¶
type Context struct {
Config configs.Config
Server *server.Server
Router *echo.Group
Container do.Injector
Resources *Resources
}
Context is the framework surface given to a module during route mounting.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is one installable business capability in the application runtime.
func BusinessModules ¶
func BusinessModules() []Module
BusinessModules returns the business modules installed by the default runtime.
func NewModule ¶
func NewModule(name string, opts ...ModuleOption) Module
NewModule creates a boot module with explicit providers and route mounts.
type ModuleOption ¶
type ModuleOption func(*Module)
ModuleOption customizes one boot module.
func Provide ¶
func Provide[T any](provider do.Provider[T]) ModuleOption
Provide registers one do provider when the module is installed.
func Route ¶
func Route[H any](register func(*echo.Group, H)) ModuleOption
Route mounts an HTTP route set after its handler has been resolved from do.
func Use ¶
func Use(register func(do.Injector)) ModuleOption
Use installs a raw do package or binding as part of the module.
type Option ¶
type Option func(*appOptions)
Option customizes application assembly.
func WithModules ¶
WithModules installs business modules into the boot-owned dependency graph.
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
Resources exposes framework-owned infrastructure resources to modules.