Versions in this module Expand all Collapse all v0 v0.0.8 Feb 11, 2024 Changes in this version + const CacheExpireHeaderKey + const RequestHeaderKey + const XFromCache + var CacheDirectory = path.Join(os.TempDir(), fmt.Sprintf("%s-cache", settings.CliBinaryName)) + var ErrNoDateHeader = errors.New("no Date header") + var MaxCacheAgeInSeconds = 300 + var TraceHeaderKey = "X-TRACE" + func CachedResponse(c Cache, req *http.Request) (resp *http.Response, err error) + func CreateHttpErrorMessage(url string, body string, statusCode int) string + func Date(respHeaders http.Header) (date time.Time, err error) + func HttpErrorPropagatedRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error) + func NewHttpRetryClient(log *zap.Logger, maxRetries int) *retryablehttp.Client + func SetCacheExpireHeader(headers http.Header) + func SetCommonLoggingAttributes(ctx context.Context, c *gin.Context) (*zap.Logger, context.Context) + func SignBody(secret, body []byte) []byte + type Cache interface + Delete func(key string) + Get func(key string) (responseBytes []byte, ok bool) + Set func(key string, responseBytes []byte) + type ErrorDetail struct + Detail string + Instance string + Status int64 + Title string + Type string + type MemoryCache struct + func NewMemoryCache() *MemoryCache + func (c *MemoryCache) Delete(key string) + func (c *MemoryCache) Get(key string) (resp []byte, ok bool) + func (c *MemoryCache) Set(key string, resp []byte) + type Transport struct + Cache Cache + MarkCachedResponses bool + Transport http.RoundTripper + UseLocalCacheTimes bool + func NewMemoryCacheTransport() *Transport + func NewTransport(c Cache) *Transport + func NewTransportLocalCacheTime(c Cache) *Transport + func (t *Transport) Client() *http.Client + func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) + type WebhookConfig struct + AdditionalHeaders map[string]string + BearerToken string + Body string + HookSecret string + Log *zap.Logger + MaxRetries int + SignatureHeader string + Url string + func (c *WebhookConfig) SendWebhook() error