Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPModule ¶
func NewHTTPModule(opts ...HTTPOption) fx.Option
NewHTTPModule provides HTTP middleware functionality. It includes server, error handler, health routes, and middleware components.
Options:
- WithServerConfig: provide static server Config (useful for tests)
Example usage:
// Production - loads config from viper
modules.NewHTTPModule()
// Testing - with static config
modules.NewHTTPModule(
modules.WithServerConfig(server.Config{...}),
)
Types ¶
type HTTPOption ¶
type HTTPOption func(*httpOptions)
HTTPOption is a functional option for configuring the HTTP module.
func WithServerConfig ¶
func WithServerConfig(cfg server.Config) HTTPOption
WithServerConfig provides a static server Config (useful for tests). When set, the server configuration will not be loaded from viper.
Click to show internal directories.
Click to hide internal directories.