ctx

package
v0.0.0-...-d744151 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ApisixVarsKey = "apisix_vars"
View Source
const RequestBodyKey = "$request_body"
View Source
const RequestVarsKey = "request_vars"

Variables

This section is empty.

Functions

func AttachConsumer

func AttachConsumer(r *http.Request, consumer resource.Consumer)

func GetApisixVar

func GetApisixVar(r *http.Request, key string) any

func GetApisixVars

func GetApisixVars(r *http.Request) map[string]any

func GetBool

func GetBool(c context.Context, key string) (b bool)

GetBool returns the value associated with the key as a bool.

func GetBytes

func GetBytes(c context.Context, key string) (b []byte)

func GetDuration

func GetDuration(c context.Context, key string) (d time.Duration)

GetDuration returns the value associated with the key as a time.Duration.

func GetInt

func GetInt(c context.Context, key string) (i int)

GetInt returns the value associated with the key as a int.

func GetInt64

func GetInt64(c context.Context, key string) (i int64)

GetInt64 returns the value associated with the key as a int64.

func GetMapStringAny

func GetMapStringAny(c context.Context, key string) (m map[string]any)

GetMapStringAny returns the value associated with the key as a map[string]any.

func GetMapStringString

func GetMapStringString(c context.Context, key string) (m map[string]string)

GetMapStringString returns the value associated with the key as a map[string]string.

func GetRequestVar

func GetRequestVar(r *http.Request, key string) any

func GetRequestVars

func GetRequestVars(r *http.Request) map[string]any

func GetSliceString

func GetSliceString(c context.Context, key string) (s []string)

GetSliceString returns the value associated with the key as a []string.

func GetString

func GetString(c context.Context, key string) (s string)

GetString returns the value associated with the key as a string.

func GetTime

func GetTime(c context.Context, key string) (t time.Time)

GetTime returns the value associated with the key as a time.Time.

func ReadRequestBody

func ReadRequestBody(r *http.Request) ([]byte, error)

ReadRequestBody will return the body in []byte, without change the origin body

func RecycleVars

func RecycleVars(r *http.Request)

func RegisterApisixVar

func RegisterApisixVar(r *http.Request, key string, val any)

func RegisterRequestVar

func RegisterRequestVar(r *http.Request, key string, val any)

func WithApisixVars

func WithApisixVars(r *http.Request, vars map[string]string) *http.Request

func WithRequestVars

func WithRequestVars(r *http.Request) *http.Request

Types

This section is empty.

Jump to

Keyboard shortcuts

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