Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App represents the VEF application server. It wraps a Fiber application and manages the HTTP server lifecycle.
func New ¶
New creates a new VEF application instance with the provided dependencies. It initializes the Fiber application, applies middlewares, and registers Api routes. Returns an error if the application cannot be configured properly.
func (*App) Start ¶
Start starts the VEF application HTTP server. It returns a channel that will receive nil when the server is ready, or an error if the server fails to start. The server runs in a goroutine and can be stopped using the Stop method.
func (*App) Stop ¶
Stop gracefully shuts down the VEF application server. It waits up to 30 seconds for active connections to close.
func (*App) Test ¶
Test sends an HTTP request to the application for testing purposes. This method is designed for unit and integration tests. The optional timeout parameter specifies the maximum duration to wait for a response. If no timeout is provided or timeout is zero, the default timeout is used.
type AppParams ¶
type AppParams struct {
fx.In
Config *config.AppConfig
Middlewares []Middleware `group:"vef:app:middlewares"`
ApiEngine api.Engine ` name:"vef:api:engine"`
OpenApiEngine api.Engine ` name:"vef:openapi:engine"`
}
AppParams contains all dependencies required to create a VEF application. It is used with Uber FX dependency injection.
type CustomCtx ¶
type CustomCtx struct {
fiber.DefaultCtx
// contains filtered or unexported fields
}
CustomCtx is a custom Fiber context that extends the default context with additional framework-specific functionality like logger, principal, and database access.
func (*CustomCtx) Principal ¶
Principal returns the authenticated principal (user/system/app) for the current request.