variable

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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"
	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"

	// grpc
	GRPCStatusCode = "$grpc.status_code"
	GRPCMessage    = "$grpc.message"

	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func Get

func Get(key string, c *app.RequestContext) (val any, found bool)

func GetBool

func GetBool(key string, c *app.RequestContext) bool

func GetFloat32

func GetFloat32(key string, c *app.RequestContext) float32

func GetFloat64

func GetFloat64(key string, c *app.RequestContext) float64

func GetInt32

func GetInt32(key string, c *app.RequestContext) int32

func GetInt64

func GetInt64(key string, c *app.RequestContext) int64

func GetString

func GetString(key string, c *app.RequestContext) string

func GetTime added in v0.3.0

func GetTime(key string, c *app.RequestContext) time.Time

func IsDirective

func IsDirective(key string) bool

func ParseDirectives added in v0.2.0

func ParseDirectives(content string) []string

Types

type RequestOriginal added in v0.2.0

type RequestOriginal struct {
	ServerID string
	Scheme   []byte
	Host     []byte
	Method   []byte
	Path     []byte
	Query    []byte
	Protocol string
}

type RequestRoute added in v0.2.0

type RequestRoute struct {
	RouteID   string
	Route     string
	ServiceID string
}

Jump to

Keyboard shortcuts

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