Documentation
¶
Index ¶
Constants ¶
const RedactedURL = "[REDACTED]"
RedactedURL replaces the URL of an error that must not leak it.
Variables ¶
This section is empty.
Functions ¶
func RedactURL ¶
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 ¶
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 ¶
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. |