gin

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBasicHandlers

func AddBasicHandlers(router *gin.Engine, config *MiddlewaresConfig, logger *logger.Logger) error

AddBasicHandlers will add basic handlers required by a Server. Library Ref: https://github.com/gin-gonic/contrib

Types

type MiddlewaresConfig

type MiddlewaresConfig struct {
	DebugEnabled      bool
	PrometheusEnabled bool
	RateLimiterConfig struct {
		Enabled    bool
		Interval   time.Duration
		BucketSize int
	}
	SecureOptions struct {
		Enabled      bool
		AllowedHosts []string
		SSLHost      string
	}
	CorsOptions struct {
		Enabled         bool
		AllowOrigins    []string
		AllowMethods    []string
		AllowHeaders    []string
		ExposeHeader    []string
		AllowOriginFunc func(origin string) bool
		MaxAge          time.Duration
	}
	StaticFilesOptions struct {
		Enabled    bool
		ServeFiles []struct {
			Prefix                 string
			FilePath               string
			AllowDirectoryIndexing bool
		}
	}
	NewRelicOptions struct {
		ServiceName string
		LicenseKey  string
	}
}

MiddlewaresConfig is a set of middlewares related config params

Directories

Path Synopsis
Package errors contains the error handler controller
Package errors contains the error handler controller

Jump to

Keyboard shortcuts

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