# 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
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
# Functions
AuthenticateUser propagates the user ID from HTTP headers back to the request's context.
ClientHTTPStatusAndError returns error and http status that is "safe" to return to client without exposing any implementation details.
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.
InstrumentedHTTPClient returns a HTTP client with tracing instrumented default RoundTripper.
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.
LogRequest logs the request parameters.
ParseTime parses the string into an int64, milliseconds since epoch.
RecoverPanic is a helper function to recover from panic and return an error.
RegisterOrGet registers the collector c with the provided registerer.
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.
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
No description provided by the author
No description provided by the author
WithSourceIPs returns a Logger that has information about the source IPs in its details.
NewTimeoutInterceptor returns a new timeout interceptor.
WrapWithInstrumentedHTTPTransport wraps the given RoundTripper with an tracing instrumented one.
WriteError write a go error with the correct status code.
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
No description provided by the author
No description provided by the author
Sharding strategies.
No description provided by the author
StatusClientClosedRequest is the status code for when a client request cancellation of an http request.
# Variables
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
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.
Log middleware logs http requests.
# Type aliases
No description provided by the author