httpreq

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LokiEncodingFlagsHeader              = "X-Loki-Response-Encoding-Flags"
	FlagCategorizeLabels    EncodingFlag = "categorize-labels"

	EncodeFlagsDelimiter = ","
)

Variables

View Source
var (
	// LokiActorPathHeader is the name of the header e.g. used to enqueue requests in hierarchical queues.
	LokiActorPathHeader               = "X-Loki-Actor-Path"
	LokiDisablePipelineWrappersHeader = "X-Loki-Disable-Pipeline-Wrappers"

	// LokiActorPathDelimiter is the delimiter used to serialise the hierarchy of the actor.
	LokiActorPathDelimiter = "|"
)
View Source
var (
	QueryTagsHTTPHeader ctxKey = "X-Query-Tags"

	QueryQueueTimeHTTPHeader ctxKey = "X-Query-Queue-Time"
)

Functions

func AddEncodingFlags

func AddEncodingFlags(req *http.Request, flags EncodingFlags)

func AddEncodingFlagsToContext

func AddEncodingFlagsToContext(ctx context.Context, flags EncodingFlags) context.Context

func ExtractActorPath

func ExtractActorPath(ctx context.Context) []string

func ExtractHeader

func ExtractHeader(ctx context.Context, name string) string

func ExtractQueryMetricsMiddleware

func ExtractQueryMetricsMiddleware() middleware.Interface

func ExtractQueryTagsFromContext added in v3.2.0

func ExtractQueryTagsFromContext(ctx context.Context) string

func ExtractQueryTagsFromHTTP

func ExtractQueryTagsFromHTTP(req *http.Request) string

func ExtractQueryTagsMiddleware

func ExtractQueryTagsMiddleware() middleware.Interface

func InjectActorPath

func InjectActorPath(ctx context.Context, value string) context.Context

func InjectHeader

func InjectHeader(ctx context.Context, key, value string) context.Context

func InjectQueryTags

func InjectQueryTags(ctx context.Context, tags string) context.Context

func PropagateHeadersMiddleware

func PropagateHeadersMiddleware(headers ...string) middleware.Interface

Types

type EncodingFlag

type EncodingFlag string

type EncodingFlags

type EncodingFlags map[EncodingFlag]struct{}

func ExtractEncodingFlags

func ExtractEncodingFlags(req *http.Request) EncodingFlags

func ExtractEncodingFlagsFromCtx

func ExtractEncodingFlagsFromCtx(ctx context.Context) EncodingFlags

func ExtractEncodingFlagsFromProto

func ExtractEncodingFlagsFromProto(req *httpgrpc.HTTPRequest) EncodingFlags

func NewEncodingFlags

func NewEncodingFlags(flags ...EncodingFlag) EncodingFlags

func ParseEncodingFlags

func ParseEncodingFlags(rawFlags string) EncodingFlags

func (*EncodingFlags) Has

func (ef *EncodingFlags) Has(flag EncodingFlag) bool

func (*EncodingFlags) Set

func (ef *EncodingFlags) Set(flags ...EncodingFlag)

func (*EncodingFlags) String

func (ef *EncodingFlags) String() string

Jump to

Keyboard shortcuts

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