internal

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const RedactedURL = "[REDACTED]"

RedactedURL replaces the URL of an error that must not leak it.

Variables

This section is empty.

Functions

func RedactURL

func RedactURL(raw string) string

RedactURL returns a URL that is safe to put in an error or a log: only the scheme and the host are kept. The user info, the path (tokens are sometimes carried by it), the query string and the fragment may carry credentials, so they are dropped. A value that can not be parsed is replaced entirely, because its content is unknown.

func RedactURLError

func RedactURLError(err error) error

RedactURLError removes the URLs from the errors returned by net/http and net/url.

Those errors embed the full request URL, but the URL of a webhook (Slack, Discord, ...) or of an endpoint may carry a secret (token in the path, credentials in the user info or in the query string). The operation and the root cause are kept so the error stays actionable. When the cause itself quotes a URL (for example a malformed redirect Location header), the cause is rewritten without it. The cause of a parse error is always replaced, because it quotes the unparsable input.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is an interface over http.Client to make mock easier.

func DefaultHTTPClient

func DefaultHTTPClient() HTTPClient

func HTTPClientWithTimeout

func HTTPClientWithTimeout(timeout time.Duration) HTTPClient

func NewHTTPClient

func NewHTTPClient(timeout time.Duration, transport http.RoundTripper) HTTPClient

Directories

Path Synopsis
Package folderloader holds the provider independent logic of the "folder mode" of the retrievers (S3, GCS, Azure Blob...): list the files under a prefix, download and parse the ones that changed, and merge all of them into a single flag set.
Package folderloader holds the provider independent logic of the "folder mode" of the retrievers (S3, GCS, Azure Blob...): list the files under a prefix, download and parse the ones that changed, and merge all of them into a single flag set.
Package httpprovider implements a koanf provider that loads config over HTTP(S), watches it by polling, and keeps a local copy of the last valid config so a service can still start when the network is down.
Package httpprovider implements a koanf provider that loads config over HTTP(S), watches it by polling, and keeps a local copy of the last valid config so a service can still start when the network is down.
Package loadtest contains the flag fixtures, the exporter behaviours and the soak harness used to measure the throughput and the memory stability of semaphore.
Package loadtest contains the flag fixtures, the exporter behaviours and the soak harness used to measure the throughput and the memory stability of semaphore.
cmd/soak command
Command soak runs a max-rate load against the library or a real relay proxy (loopback HTTP), with event tracking on and a selectable exporter behaviour, and prints a time series and a "memory stable" verdict.
Command soak runs a max-rate load against the library or a real relay proxy (loopback HTTP), with event tracking on and a selectable exporter behaviour, and prints a time series and a "memory stable" verdict.
relay
Package relay starts an in-process relay proxy for the benchmarks and the soak harness.
Package relay starts an in-process relay proxy for the benchmarks and the soak harness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL