Documentation
¶
Overview ¶
Package fiberserver provides a lakta module for HTTP servers using Fiber.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Instance name
Name string `koanf:"-"`
// Host specifies the server's hostname or IP address to bind.
Host string `koanf:"host"`
// Port specifies the port number the server listens on.
Port uint16 `koanf:"port"`
// HealthPath defines the endpoint path for the health check.
HealthPath string `koanf:"health_path"`
// Defaults stores the base fiber.Config values that can be overridden by Raw or koanf configurations.
Defaults *fiber.Config `code_only:"WithDefaults" koanf:"-"`
// Routers defines a list of Router functions to configure routes for a Fiber application.
Routers []Router `code_only:"WithRouter" koanf:"-"`
// Raw passthrough for fiber.Config fields (app_name, read_timeout, etc.)
Raw config.Passthrough[fiber.Config] `koanf:",remain"`
}
Config represents configuration for HTTP Fiber server Module
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig returns default configuration
func (*Config) LoadFromKoanf ¶
LoadFromKoanf loads configuration from koanf instance at the given path. Preserves existing Raw entries as defaults, letting koanf values take precedence.
func (*Config) ToFiberConfig ¶
ToFiberConfig returns a fiber.Config with Defaults and Raw fields applied.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module manages a Fiber HTTP server lifecycle.
func (*Module) ConfigPath ¶
ConfigPath returns the koanf path for this module's configuration.
func (*Module) Init ¶
Init loads configuration, creates the Fiber app, and registers middleware and routes.
func (*Module) LoadConfig ¶
LoadConfig loads configuration from koanf.
type Option ¶
type Option func(m *Config)
Option configures the Module.
func WithDefaults ¶ added in v0.0.2
WithDefaults sets typed fiber.Config defaults that can be overridden by Raw/koanf values.
func WithHealthPath ¶ added in v0.0.2
WithHealthPath sets the health check endpoint path.
func WithRouter ¶
WithRouter adds router to the list of routers to be invoked (code-only).