Documentation ¶
Index ¶
- func DecodeBody[Out any](l *zap.Logger, r *http.Request) (*Out, error)
- func ExtractJWTBearerToken(r *http.Request) (string, error)
- func ExtractRequestID(r *http.Request) string
- func GetRequestDuration(ctx context.Context) (time.Duration, error)
- func RetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error)
- func RobustHTTPClient(logger *zap.Logger) *http.Client
- type LeveledZap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRequestID ¶
func RetryPolicy ¶
RetryPolicy is a custom wrapper around retryablehttp.DefaultRetryPolicy. It treats `429 Too Many Requests` as non-retryable, so the application can decide how to deal with rate-limiting.
Types ¶
type LeveledZap ¶
type LeveledZap struct {
// contains filtered or unexported fields
}
func (LeveledZap) Debug ¶
func (l LeveledZap) Debug(msg string, keysAndValues ...interface{})
func (LeveledZap) Error ¶
func (l LeveledZap) Error(msg string, keysAndValues ...interface{})
re-writes HTTP client ERROR to WARN level (because of retries)
func (LeveledZap) Info ¶
func (l LeveledZap) Info(msg string, keysAndValues ...interface{})
func (LeveledZap) Warn ¶
func (l LeveledZap) Warn(msg string, keysAndValues ...interface{})
Click to show internal directories.
Click to hide internal directories.