http

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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 Create

func Create() *fiber.App

Create is a function that creates the app.

func CreateRoutes

func CreateRoutes(db *gorm.DB, app *fiber.App)

CreateRoutes is a function that creates the routes.

func EnableCORS

func EnableCORS(app *fiber.App)

It enables the cors middleware.

func EnableCompression

func EnableCompression(app *fiber.App)

It enables the compression middleware.

func EnableETAG

func EnableETAG(app *fiber.App)

It enables the etag middleware.

func EnableHealthCheck

func EnableHealthCheck(app *fiber.App)

It enables the health check middleware.

func EnableLogger

func EnableLogger(app *fiber.App)

It enables the logger middleware.

func EnableMetrics

func EnableMetrics(app *fiber.App)

It enables the metrics middleware.

func EnableMonitoring

func EnableMonitoring(app *fiber.App)

It enables the monitoring middleware.

func EnableRecovers

func EnableRecovers(app *fiber.App)

It enables the recovery middleware.

func EnableRequestID

func EnableRequestID(app *fiber.App)

It enables the request id middleware.

func ErrorHandler

func ErrorHandler(ctx *fiber.Ctx, err error) error

ErrorHandler is the error handler for the app.

func Start

func Start(app *fiber.App, db *gorm.DB, hostname string, port string) error

Start is a function that starts the app.

func StartSecure

func StartSecure(app *fiber.App, db *gorm.DB, hostname string, port string, certFile string, keyFile string) error

StartSecure is a function that starts the app in secure mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL