rkmid

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 28

Documentation

Index

Constants

View Source
const (
	HeaderAuthorization                   = "authorization"
	HeaderApiKey                          = "X-API-Key"
	HeaderRequestId                       = "X-Request-Id"
	HeaderTraceId                         = "X-Trace-Id"
	HeaderOrigin                          = "Origin"
	HeaderAccessControlAllowOrigin        = "Access-Control-Allow-Origin"
	HeaderAccessControlAllowCredentials   = "Access-Control-Allow-Credentials"
	HeaderAccessControlExposeHeaders      = "Access-Control-Expose-Headers"
	HeaderVary                            = "Vary"
	HeaderAccessControlRequestMethod      = "Access-Control-Request-Method"
	HeaderAccessControlRequestHeaders     = "Access-Control-Request-Headers"
	HeaderAccessControlAllowMethods       = "Access-Control-Allow-Methods"
	HeaderAccessControlAllowHeaders       = "Access-Control-Allow-Headers"
	HeaderAccessControlMaxAge             = "Access-Control-Max-Age"
	HeaderContentEncoding                 = "Content-Encoding"
	HeaderContentLength                   = "Content-Length"
	HeaderContentType                     = "Content-Type"
	HeaderAcceptEncoding                  = "Accept-Encoding"
	HeaderXXSSProtection                  = "X-Xss-Protection"
	HeaderXContentTypeOptions             = "X-Content-Type-Options"
	HeaderXFrameOptions                   = "X-Frame-Options"
	HeaderXForwardedProto                 = "X-Forwarded-Proto"
	HeaderStrictTransportSecurity         = "Strict-Transport-Security"
	HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
	HeaderContentSecurityPolicy           = "Content-Security-Policy"
	HeaderReferrerPolicy                  = "Referrer-Policy"
	HeaderXCSRFToken                      = "X-CSRF-Token"
	HeaderCookie                          = "Cookie"
)

Variables

View Source
var (
	EntryNameKey      = &entryNameKey{}
	EntryTypeKey      = &entryTypeKey{}
	EventKey          = &eventKey{}
	LoggerKey         = &loggerKey{}
	TracerKey         = &tracerKey{}
	SpanKey           = &spanKey{}
	TracerProviderKey = &tracerProviderKey{}
	PropagatorKey     = &propagatorKey{}
	JwtTokenKey       = &jwtTokenKey{}
	CsrfTokenKey      = &csrfTokenKey{}
	// Realm environment variable
	Realm = zap.String("realm", rkcommon.GetEnvValueOrDefault("REALM", "*"))
	// Region environment variable
	Region = zap.String("region", rkcommon.GetEnvValueOrDefault("REGION", "*"))
	// AZ environment variable
	AZ = zap.String("az", rkcommon.GetEnvValueOrDefault("AZ", "*"))
	// Domain environment variable
	Domain = zap.String("domain", rkcommon.GetEnvValueOrDefault("DOMAIN", "*"))
	// LocalIp read local IP from localhost
	LocalIp = zap.String("localIp", rkcommon.GetLocalIP())
	// LocalHostname read hostname from localhost
	LocalHostname = zap.String("localHostname", rkcommon.GetLocalHostname())

	IgnorePrefixGlobal = ignorePathPrefix
)

Functions

func GetRemoteAddressSet

func GetRemoteAddressSet(req *http.Request) (remoteIp, remotePort string)

GetRemoteAddressSet returns remote endpoint information set including IP, Port. We will do as best as we can to determine it. If fails, then just return default ones.

Types

This section is empty.

Directories

Path Synopsis
package rkmidauth provide auth related options
package rkmidauth provide auth related options
package rkmidcors provide cors related options
package rkmidcors provide cors related options
package rkmidcsrf provide auth related options
package rkmidcsrf provide auth related options
Package rkmidjwt is a middleware for JWT
Package rkmidjwt is a middleware for JWT
package rkmidlog provide options
package rkmidlog provide options
Package rkmidmeta is a middleware for metadata
Package rkmidmeta is a middleware for metadata
Package rkmidmetrics has couple of utility functions to start prometheus and pushgateway client locally.
Package rkmidmetrics has couple of utility functions to start prometheus and pushgateway client locally.
package rkmidpanic provide options
package rkmidpanic provide options
package rkmidlimit provide options
package rkmidlimit provide options
package rkmidsec provide auth related options
package rkmidsec provide auth related options
package rkmidtimeout provide options
package rkmidtimeout provide options
Package rkmidtrace is a middleware for recording tracing
Package rkmidtrace is a middleware for recording tracing

Jump to

Keyboard shortcuts

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