dclgin

package
v0.0.0-...-d628aa1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const BasicHeaders = "Accept,Accept-Encoding, Access-Control-Allow-Credentials, Access-Control-Allow-Headers, Access-Control-Allow-Methods, Access-Control-Allow-Origin, " +
	"Access-Control-Max-Age, Age, Allow,Authentication-Info, Authorization,CONNECT, Cache-Control, Connection, Content-Base, Content-Length, Content-Location, " +
	"Content-MD5, Content-Type, Content-Version, Cookie, DELETE,Destination, Expires, From, GET, HEAD, Host, Keep-Alive, Location, MIME-Version, OPTION, OPTIONS, " +
	"Optional, Origin, POST, PUT, Protocol, Proxy-Authenticate, Proxy-Authentication-Info, Proxy-Authorization, Proxy-Features, Public, Referer, Refresh, Resolver-Location, " +
	"Sec-Websocket-Extensions, Sec-Websocket-Key, Sec-Websocket-Origin, Sec-Websocket-Protocol, Sec-Websocket-Version, Security-Scheme, Server, Set-Cookie, et-Cookie2, SetProfile, " +
	"Status, Timeout, Title, URI, User-Agent, Version, WWW-Authenticate, X-Content-Duration, X-Content-Security-Policy, X-Content-Type-Options, X-CustomHeader, X-DNSPrefetch-Control, " +
	"X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto, X-Frame-Options, X-Modified, X-OTHER, X-PING, X-Requested-With"

Because FireFox does not handle '*' in the Access-Control-Allow-Headers header

Variables

This section is empty.

Functions

func CorsMiddleware

func CorsMiddleware() gin.HandlerFunc

func EnableTrace

func EnableTrace(config *HttpMetricsConfig, router *gin.Engine) error

func PrefligthChecksMiddleware

func PrefligthChecksMiddleware(allowedMethods string, allowedHeaders string) func(c *gin.Context)

func RegisterVersionEndpoint

func RegisterVersionEndpoint(r gin.IRoutes)

func ServiceStatusHandler

func ServiceStatusHandler(runChecks func() map[string]string) func(c *gin.Context)

runChecks checks the status of the service and returns a map of errors

func StopTrace

func StopTrace()

func Version

func Version() string

Types

type HttpMetricsConfig

type HttpMetricsConfig struct {
	TraceName            string
	AnalyticsRateEnabled bool
}

Jump to

Keyboard shortcuts

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