package
0.0.0-20241004052545-caa2fb9b60ae
Repository: https://github.com/grafana/mimir.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package gziphandler mirrors the package github.com/nytimes/gziphandler until https://github.com/nytimes/gziphandler/pull/112 is merged.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package noauth provides middlewares that injects a tenant ID so the rest of the code can continue to be multitenant.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CloseAndExhaust closes and then tries to exhaust stream.
DiffConfig utility function that returns the diff between two config map objects.
DurationWithJitter returns random duration from "input - input*variance" to "input + input*variance" interval.
DurationWithNegativeJitter returns random duration from "input - input*variance" to "input" interval.
DurationWithPositiveJitter returns random duration from "input" to "input + input*variance" interval.
FormatTimeMillis returns a human readable version of the input time (in milliseconds).
FormatTimeModel returns a human readable version of the input time.
IsHTTPStatusCode returns true if the given code is a valid HTTP status code, or false otherwise.
IsRequestBodyTooLarge returns true if the error is "http: request body too large".
No description provided by the author
LabelMatchersToString returns a string representing the input label matchers.
MergeSlices merges a set of sorted string slices into a single ones while removing all duplicates.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewAllowedTenants builds new allowed tenants based on enabled and disabled tenants.
NewBucketedBufferPool returns a new Pool for byte slices with bucketing.
NewBufferPool returns a new Pool for byte slices.
NewDisableableTicker essentially wraps NewTicker but allows the ticker to be disabled by passing zero duration as the interval.
NewRequestBuffers returns a new RequestBuffers given a Pool.
NewVariableTicker wrap time.Ticker to Reset() the ticker with the next duration (picked from input durations) after each tick.
ParseProtoReader parses a compressed proto from an io.Reader.
ParseRequestFormWithoutConsumingBody parsed and returns the request parameters (query string and/or request body) from the input http.Request.
ParseTime parses the string into an int64, milliseconds since epoch.
ParseTimeParam parses the desired time param from a Prometheus http request into an int64, milliseconds since epoch.
ReadRequestBodyWithoutConsuming makes a copy of the request body bytes without consuming the body, so it can be read again later.
RemoveSliceIndexes takes a slice of elements of any type and a sorted slice of indexes of elements in the former slice.
RenderHTTPResponse either responds with JSON or a rendered HTML page using the passed in template by checking the Accepts header.
SerializeProtoResponse serializes a protobuf response into an HTTP response.
ShuffleShardExpectedInstances returns the total number of instances that should be selected for a given tenant.
ShuffleShardExpectedInstancesPerZone returns the number of instances that should be selected for each zone when zone-aware replication is enabled.
ShuffleShardSeed returns seed for random number generator, computed from provided identifier.
StreamWriteYAMLResponse stream writes data as http response.
StringsContain returns true if the search value is within the list of input values.
StringsMap returns a map where keys are input values.
TimeFromMillis is a helper to turn milliseconds -> time.Time.
No description provided by the author
TrackRegisteredFlags returns the flags that were registered by the register function.
No description provided by the author
No description provided by the author
WriteHTMLResponse sends message as text/html response with 200 status code.
WriteJSONResponse writes some JSON as a HTTP response.
WriteTextResponse sends message as text/plain response with 200 status code.
WriteYAMLResponse writes some YAML as a HTTP response.
YAMLMarshalUnmarshal utility function that converts a YAML interface in a map doing marshal and unmarshal of the parameter.
No description provided by the author

# Constants

Values for CompressionType.
Values for CompressionType.
Values for CompressionType.
Sharding strategies.
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
ActiveUsers keeps track of latest user's activity timestamp, and allows purging users that are no longer active.
ActiveUsersCleanupService tracks active users, and periodically purges inactive ones while running.
AllowedTenants that can answer whether tenant is allowed or not based on configuration.
BasicAuth configures basic authentication for HTTP clients.
CommonRingConfig is the configuration commonly used by components that use a ring for various coordination tasks such as sharding or service discovery.
No description provided by the author
RegisteredFlags contains the flags registered by some config.
RequestBuffers provides pooled request buffers.

# Interfaces

Pool is an abstraction for a pool of byte slices.
No description provided by the author
No description provided by the author

# Type aliases

CloserFunc is like http.HandlerFunc but for io.Closer.
CompressionType for encoding and decoding requests and responses.
MatchersStringer implements Stringer for a slice of Prometheus matchers.
MultiMatchersStringer implements Stringer for a slice of slices of Prometheus matchers.
UnixSeconds is Unix timestamp with seconds precision.