Documentation
¶
Index ¶
- Variables
- func New(config Config, option Options, logger *zap.Logger) (*fiber.App, error)
- func NewJSONErrorHandler(logger *zap.Logger) fiber.ErrorHandler
- func NewViewsErrorHandler(logger *zap.Logger, template string, layouts ...string) fiber.ErrorHandler
- type Config
- type Error
- type ErrorResponse
- type JSONErrorResponse
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "http", fx.Decorate(func(log *zap.Logger) *zap.Logger { return log.Named("http") }), fx.Provide(New), fx.Invoke(func(lc fx.Lifecycle, cfg Config, app *fiber.App, logger *zap.Logger) { lc.Append(fx.Hook{ OnStart: func(ctx context.Context) error { go func() { _ = app.Listen(cfg.Address) }() logger.Info("server started") return nil }, OnStop: func(ctx context.Context) error { logger.Warn("shutting down server") _ = app.ShutdownWithContext(ctx) return nil }, }) }), )
Functions ¶
func NewJSONErrorHandler ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error Error `json:"error"`
}
type JSONErrorResponse ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) WithErrorHandler ¶
func (*Options) WithGetOnly ¶
Click to show internal directories.
Click to hide internal directories.