Documentation
¶
Index ¶
- func Config(name ...string) *mcfg.Config
- func DB(name ...string) *mdb.DB
- func DBContext(ctx context.Context, name ...string) *mdb.DB
- func Log(name ...string) *mlog.Logger
- func Redis(name ...string) *mredis.Redis
- func RequestFromCtx(ctx context.Context) *mhttp.Request
- func Server(name ...string) *mhttp.Server
- type App
- type AppServer
- type Meta
- type Option
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBContext ¶
DBContext returns the instance of the database with the specified name and context.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the core application structure that manages the lifecycle of services and hooks.
type AppServer ¶ added in v0.1.4
type AppServer interface {
// Start starts the server and blocks.
// It is expected to return an error if the server fails to start.
// A call to Stop should cause Start to unblock and return nil.
Start(ctx context.Context) error
// Stop gracefully shuts down the server.
// It should be idempotent and is expected to be called by the app framework.
Stop(ctx context.Context) error
}
AppServer defines the interface for a server that can be managed by the App.
type Option ¶ added in v0.1.4
type Option func(*App)
An Option configures an App.
func WithLogger ¶ added in v0.1.15
WithLogger sets the logger for the application.
func WithServer ¶ added in v0.1.4
WithServer adds servers to the application.
Click to show internal directories.
Click to hide internal directories.