Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureMiddleware(app *fiber.App)
- func Create() *fiber.App
- func CreateRoutes(db *gorm.DB, app *fiber.App)
- func EnableCORS(app *fiber.App)
- func EnableCompression(app *fiber.App)
- func EnableETAG(app *fiber.App)
- func EnableHealthCheck(app *fiber.App)
- func EnableLogger(app *fiber.App)
- func EnableMetrics(app *fiber.App)
- func EnableMonitoring(app *fiber.App)
- func EnableRecovers(app *fiber.App)
- func EnableRequestID(app *fiber.App)
- func ErrorHandler(ctx *fiber.Ctx, err error) error
- func Start(app *fiber.App, db *gorm.DB, hostname string, port string) error
- func StartSecure(app *fiber.App, db *gorm.DB, hostname string, port string, certFile string, ...) error
Constants ¶
View Source
const HEALTHCHECK_PATH = "/_/healthcheck"
The http path for healthcheck.
View Source
const INTERNAL_SERVER_ERROR string = "Internal Server Error"
This is a message that is sent when the server is down.
View Source
const METRICS_PATH = "/_/metrics"
The http path for metrics.
View Source
const MONITORING_PATH = "/_/monitoring"
The http path for monitoring.
View Source
const PROMETHEUS_SERVICE_NAME = "github.com/eminmuhammadi/memcache"
Prometheus service name.
Variables ¶
View Source
var APP_CONFIGURATION = fiber.Config{ EnablePrintRoutes: config.DefaultConfig.EnablePrintRoutes, ReduceMemoryUsage: config.DefaultConfig.ReduceMemoryUsage, DisableStartupMessage: config.DefaultConfig.DisableStartupMessage, BodyLimit: config.DefaultConfig.BodyLimit, Concurrency: config.DefaultConfig.Concurrency, ReadBufferSize: config.DefaultConfig.ReadBufferSize, WriteBufferSize: config.DefaultConfig.WriteBufferSize, ReadTimeout: time.Second * time.Duration(config.DefaultConfig.ReadTimeout), WriteTimeout: time.Second * time.Duration(config.DefaultConfig.WriteTimeout), IdleTimeout: time.Second * time.Duration(config.DefaultConfig.IdleTimeout), JSONEncoder: json.Marshal, JSONDecoder: json.Unmarshal, ErrorHandler: ErrorHandler, Prefork: config.DefaultConfig.Prefork, }
App configuration.
Functions ¶
func ConfigureMiddleware ¶
func ConfigureMiddleware(app *fiber.App)
Default configuration for the middleware.
func CreateRoutes ¶
CreateRoutes is a function that creates the routes.
func EnableCompression ¶
func EnableCompression(app *fiber.App)
It enables the compression middleware.
func EnableHealthCheck ¶
func EnableHealthCheck(app *fiber.App)
It enables the health check middleware.
func ErrorHandler ¶
ErrorHandler is the error handler for the app.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.