Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
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. 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, a default timeout of 5 seconds is used. This is higher than Fiber's default (1s) to accommodate CI environments.
type AppParams ¶
type AppParams struct {
fx.In
Config *config.AppConfig
Middlewares []Middleware `group:"vef:app:middlewares"`
APIEngine api.Engine
}
AppParams contains all dependencies required to create a VEF application.
type CustomCtx ¶
type CustomCtx struct {
fiber.DefaultCtx
}
CustomCtx is the framework's custom Fiber context. It embeds DefaultCtx so fiber.NewWithCustomCtx can register it as the per-request context type. Request-scoped state (logger, principal, db) is stored in the request's context.Context via the contextx package rather than as struct fields here.
type Middleware ¶
type Middleware interface {
// Name returns the name of the middleware.
Name() string
// Order returns the order of the middleware. Negative orders register
// before the route handlers and positive orders after, each sorted
// ascending; the zero default registers in the before group.
Order() int
// Apply applies the middleware to the router.
Apply(router fiber.Router)
}
Middleware is a middleware for the app.
type StructValidator ¶
type StructValidator struct{}
StructValidator implements Fiber's struct validator interface.
func (*StructValidator) Validate ¶
func (*StructValidator) Validate(out any) error
Validate delegates to the framework's validator.