metadata

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package metadata provides primitives for recording metadata across the query path. Metadata is passed through the query context.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCtxData = errors.New("unable to add headers to context: no existing context data")
)

Functions

func ExtendHeaders

func ExtendHeaders(dst map[string][]string, src []*definitions.PrometheusResponseHeader)

func JoinHeaders

func JoinHeaders(ctx context.Context, headers []*definitions.PrometheusResponseHeader) error

JoinHeaders merges a Headers with the embedded Headers in a context in a concurrency-safe manner. JoinHeaders will consolidate all distinct headers but will override same-named headers in an undefined way

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context is the metadata context. It is passed through the query path and accumulates metadata.

func FromContext

func FromContext(ctx context.Context) *Context

FromContext returns the metadata context.

func NewContext

func NewContext(ctx context.Context) (*Context, context.Context)

NewContext creates a new metadata context

func (*Context) Headers

Headers returns the cache headers accumulated in the context so far.

Jump to

Keyboard shortcuts

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