Documentation
¶
Index ¶
- Constants
- Variables
- func AddPathToIgnoreGlobal(prefix ...string)
- func GenerateRequestId() string
- func GenerateRequestIdWithPrefix(prefix string) string
- func GetErrorBuilder() rkerror.ErrorBuilder
- func GetRemoteAddressSet(req *http.Request) (remoteIp, remotePort string)
- func SetErrorBuilder(builder rkerror.ErrorBuilder)
- func ShouldIgnoreGlobal(urlPath string) bool
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{} // Domain environment variable Domain = zap.String("domain", getEnvValueOrDefault("DOMAIN", "*")) // LocalIp read local IP from localhost LocalIp = zap.String("localIp", getLocalIP()) // LocalHostname read hostname from localhost LocalHostname = zap.String("localHostname", getLocalHostname()) )
Functions ¶
func AddPathToIgnoreGlobal ¶
func AddPathToIgnoreGlobal(prefix ...string)
func GenerateRequestId ¶
func GenerateRequestId() string
GenerateRequestId generate request id based on google/uuid. UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services.
A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to maps or compared directly.
func GenerateRequestIdWithPrefix ¶
GenerateRequestIdWithPrefix generate request id based on google/uuid. UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services.
A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to maps or compared directly.
func GetErrorBuilder ¶ added in v2.2.0
func GetErrorBuilder() rkerror.ErrorBuilder
func GetRemoteAddressSet ¶
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.
func SetErrorBuilder ¶ added in v2.2.0
func SetErrorBuilder(builder rkerror.ErrorBuilder)
func ShouldIgnoreGlobal ¶
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 rkmidpanic provide options
|
Package rkmidpanic provide options |
Package rkmidprom has a couple of utility functions to start prometheus and pushgateway client locally.
|
Package rkmidprom has a couple of utility functions to start prometheus and pushgateway client locally. |
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 |
Click to show internal directories.
Click to hide internal directories.