gin

package
v0.0.0-...-bc6e940 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 19 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

Jump to

Keyboard shortcuts

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