Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultReadTimeout = 3 * time.Second DefaultWriteTimeout = 3 * time.Second DefaultServerHeader = "Fiber" DefaultBodyLimit = 4 * 1024 * 1024 // 4 MB DefaultPort = "8080" DefaultAllowedOrigins = "*" DefaultShutdownTimeout = 5 * time.Second DefaultSwaggerUIPath = "/api/swagger/*" DefaultHost = "localhost" )
Variables ¶
This section is empty.
Functions ¶
func InjectTokenSwaggerUI ¶
func InjectTokenSwaggerUI(t string)
func WithConfig ¶
func WithConfig(cfg *HttpServerConfig) func(*HttpServerConfig)
Types ¶
type ElasticAPM ¶
type ElasticAPM struct {
Enabled bool `mapstructure:"enabled"`
}
type Features ¶
type Features struct {
RequestID RequestID `mapstructure:"request_id"`
Proxy Proxy `mapstructure:"proxy"`
RateLimit RateLimit `mapstructure:"rate_limit"`
HealthCheck HealthCheck `mapstructure:"health_check"`
Etag Etag `mapstructure:"etag"`
ElasticAPM ElasticAPM `mapstructure:"elastic_apm"`
SwaggerUI SwaggerUI `mapstructure:"swagger_ui"`
}
type HealthCheck ¶
type HealthCheck struct {
Enabled bool `mapstructure:"enabled"`
}
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(options ...func(*HttpServerConfig)) (*HttpServer, error)
func (*HttpServer) GetApp ¶
func (s *HttpServer) GetApp() *fiber.App
func (*HttpServer) Register ¶
func (s *HttpServer) Register(method, path string, handler core.HandlerFunc, reqFactory func() any)
func (*HttpServer) Run ¶
func (s *HttpServer) Run() error
type HttpServerConfig ¶
type HttpServerConfig struct {
ReadTimeout string `mapstructure:"read_timeout"`
WriteTimeout string `mapstructure:"write_timeout"`
ServerHeader string `mapstructure:"server_header"`
BodyLimit int `mapstructure:"body_limit"`
ErrorHandler fiber.ErrorHandler
Port string `mapstructure:"port"`
Host string `mapstructure:"host"`
AllowedOrigins string `mapstructure:"allowed_origins"`
Features Features `mapstructure:"features"`
}
Click to show internal directories.
Click to hide internal directories.