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 ¶
FromContext returns the metadata context.
func NewContext ¶
NewContext creates a new metadata context
func (*Context) AddWarning ¶ added in v3.1.0
func (*Context) Headers ¶
func (c *Context) Headers() []*definitions.PrometheusResponseHeader
Headers returns the cache headers accumulated in the context so far.
Click to show internal directories.
Click to hide internal directories.