MCPcopy Create free account
hub / github.com/prometheus/prometheus / InstallCodec

Method InstallCodec

web/api/v1/api.go:384–386  ·  view source on GitHub ↗

InstallCodec adds codec to this API's available codecs. Codecs installed first take precedence over codecs installed later when evaluating wildcards in Accept headers. The first installed codec is used as a fallback when the Accept header cannot be satisfied or if there is no Accept header.

(codec Codec)

Source from the content-addressed store, hash-verified

382// Codecs installed first take precedence over codecs installed later when evaluating wildcards in Accept headers.
383// The first installed codec is used as a fallback when the Accept header cannot be satisfied or if there is no Accept header.
384func (api *API) InstallCodec(codec Codec) {
385 api.codecs = append(api.codecs, codec)
386}
387
388// ClearCodecs removes all available codecs from this API, including the default codec installed by NewAPI.
389func (api *API) ClearCodecs() {

Callers 4

NewAPIFunction · 0.95
TestRespondSuccessFunction · 0.95
BenchmarkRespondFunction · 0.95

Calls

no outgoing calls

Tested by 3

TestRespondSuccessFunction · 0.76
BenchmarkRespondFunction · 0.76