# 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
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
AuthenticateUser propagates the user ID from HTTP headers back to the request's context.
CopyDir recursively copies a directory tree, attempting to preserve permissions.
No description provided by the author
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.
GetFirstAddressOf returns the first IPv4 address of the supplied interface names, omitting any 169.254.x.x automatic private IPs if possible.
InstrumentedDefaultHTTPClient returns an http client configured with some default settings which is wrapped with a variety of instrumented RoundTrippers.
InstrumentedHTTPClient adds the associated instrumentation middlewares to the provided http client.
IsWSHandshakeRequest returns true if the given request is a websocket handshake request.
LoggerWithContext returns a Logger that has information about the current user or users and trace in its details.
LoggerWithTraceID returns a Logger that has information about the traceID in its details.
LoggerWithUserID returns a Logger that has information about the current user in its details.
LoggerWithUserIDs returns a Logger that has information about the current user or users (separated by "|") in its details.
No description provided by the author
No description provided by the author
No description provided by the author
NewDisableableTicker essentially wraps NewTicker but allows the ticker to be disabled by passing zero duration as the interval.
NewHTTPMetricMiddleware creates a new middleware that automatically instruments HTTP requests from the given router.
NewLogInterceptor logs the request parameters.
No description provided by the author
ParseTime parses the string into an int64, milliseconds since epoch.
RecoverPanic is a helper function to recover from panic and return an error.
No description provided by the author
RegisterOrGet registers the collector c with the provided registerer.
RenderHTTPResponse either responds with JSON or a rendered HTML page using the passed in template by checking the Accepts header.
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.
SplitTimeRangeByResolution splits the given time range into the minimal number of non-overlapping sub-ranges aligned with resolutions.
StableHash is a labels hashing implementation which is guaranteed to not change over time.
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
WithSourceIPs returns a Logger that has information about the source IPs in its details.
WithTimeout returns a new timeout interceptor.
WithTracingTransport wraps the given RoundTripper with a tracing instrumented one.
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
Sharding strategies.
No description provided by the author
# Variables
No description provided by the author
Logger is a global logger to use only where you cannot inject a logger.
No description provided by the author
No description provided by the author
# Structs
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.
CommonRingConfig is the configuration commonly used by components that use a ring for various coordination tasks such as sharding or service discovery.
Log middleware logs http requests.
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author