Documentation
¶
Index ¶
- Constants
- func Get(key string, c *app.RequestContext) (val any, found bool)
- func GetBool(key string, c *app.RequestContext) bool
- func GetFloat32(key string, c *app.RequestContext) float32
- func GetFloat64(key string, c *app.RequestContext) float64
- func GetInt32(key string, c *app.RequestContext) int32
- func GetInt64(key string, c *app.RequestContext) int64
- func GetString(key string, c *app.RequestContext) string
- func GetTime(key string, c *app.RequestContext) time.Time
- func IsDirective(key string) bool
- func MethodToString(m []byte) string
- func ParseDirectives(content string) []string
- type RequestOriginal
- type RequestRoute
Constants ¶
const ( // Time is the current time. Time = "$time" ServerID = "$server_id" RouteID = "$route_id" ServiceID = "$service_id" UpstreamID = "$upstream_id" RequestOrig = "$request_orig" NetworkPeerAddress = "$network.peer.address" Hostname = "$hostname" TraceID = "$trace_id" HTTPStart = "$http.start" HTTPFinish = "$http.finish" HTTPRoute = "$http.route" HTTPRequest = "$http.request" HTTPRequestSize = "$http.request.size" HTTPRequestScheme = "$http.request.scheme" HTTPRequestHost = "$http.request.host" HTTPRequestMethod = "$http.request.method" HTTPRequestPath = "$http.request.path" HTTPRequestQuery = "$http.request.query" HTTPRequestProtocol = "$http.request.protocol" HTTPRequestURI = "$http.request.uri" HTTPRequestTags = "$http.request.tags" HTTPRequestBody = "$http.request.body" HTTPResponseSize = "$http.response.size" HTTPResponseStatusCode = "$http.response.status_code" HTTPRequestDuration = "$http.request.duration" ErrorType = "$error.type" ErrorMessage = "$error.message" LogTime = "$log_time" UpstreamRequest = "$upstream.request" UpstreamRequestHost = "$upstream.request.host" UpstreamRequestMethod = "$upstream.request.method" UpstreamRequestPath = "$upstream.request.path" UpstreamRequestQuery = "$upstream.request.query" UpstreamRequestURI = "$upstream.request.uri" UpstreamRequestProtocol = "$upstream.request.protocol" UpstreamDuration = "$upstream.duration" UpstreamResponoseStatusCode = "$upstream.response.status_code" Allow = "$allow" ClientIP = "$client_ip" BifrostRoute = "$bifrost.route" TargetTimeout = "target_timeout" GRPCStatusCode = "$grpc.status_code" GRPCMessage = "$grpc.message" B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variable names used in directives.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(key string, c *app.RequestContext) (val any, found bool)
Get returns the value of a variable or directive.
func GetBool ¶
func GetBool(key string, c *app.RequestContext) bool
GetBool returns the bool value of a variable or directive.
func GetFloat32 ¶
func GetFloat32(key string, c *app.RequestContext) float32
GetFloat32 returns the float32 value of a variable or directive.
func GetFloat64 ¶
func GetFloat64(key string, c *app.RequestContext) float64
GetFloat64 returns the float64 value of a variable or directive.
func GetInt32 ¶
func GetInt32(key string, c *app.RequestContext) int32
GetInt32 returns the int32 value of a variable or directive.
func GetInt64 ¶
func GetInt64(key string, c *app.RequestContext) int64
GetInt64 returns the int64 value of a variable or directive.
func GetString ¶
func GetString(key string, c *app.RequestContext) string
GetString returns the string value of a variable or directive.
func GetTime ¶ added in v0.3.0
func GetTime(key string, c *app.RequestContext) time.Time
GetTime returns the time.Time value of a variable or directive.
func IsDirective ¶
IsDirective checks if a key is a known directive.
func MethodToString ¶ added in v0.5.0
MethodToString tries to return consts without allocation.
func ParseDirectives ¶ added in v0.2.0
ParseDirectives parses directives from a string.