Versions in this module Expand all Collapse all v0 v0.3.1 May 13, 2024 Changes in this version type Request + FullURLOverride string + PathParams map[string]string + func (r *Request) Clone() *Request + func (r *Request) SetHeader(key, value string) v0.3.0 Apr 29, 2024 Changes in this version + var DefaultMaxResponseLength int64 = 100 * 1024 * 1024 + var DefaultRetryDelay time.Duration = 500 * time.Millisecond + var ErrResponseTooLong = errors.New("response too long") + type BasicAuth struct + Password string + Username string + type Error struct + CallID string + Category1 *ErrorCategory + Category2 *ErrorCategory + Cause error + IsNetwork bool + IsRetriable bool + Message string + Path string + PrintResponseBody bool + RawResponseBody []byte + RetryDelay time.Duration + StatusCode int + Type string + func (e *Error) AddCategory(cat *ErrorCategory) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) IsInCategory(cat *ErrorCategory) bool + func (e *Error) IsUnprocessableEntity() bool + func (e *Error) ShortError() string + func (e *Error) Unwrap() error + type ErrorCategory struct + Name string + func (err *ErrorCategory) Error() string + type Request struct + Attempts int + BaseURL string + BasicAuth BasicAuth + CallID string + Context context.Context + Duration time.Duration + Error *Error + Failed func(r *Request) + Finished func(r *Request) + HTTPClient *http.Client + HTTPRequest *http.Request + HTTPResponse *http.Response + Headers http.Header + Input any + LastRetryDelay time.Duration + MaxAttempts int + MaxResponseLength int64 + Method string + OutputPtr any + ParseErrorResponse func(r *Request) + ParseResponse func(r *Request) error + Path string + QueryParams url.Values + RawRequestBody []byte + RawResponseBody []byte + RequestBodyContentType string + RetryDelay time.Duration + ShouldStart func(r *Request) error + Started func(r *Request) + UserData map[string]any + UserObject any + ValidateOutput func() error + func (r *Request) Curl() string + func (r *Request) Do() error + func (r *Request) Init() + func (r *Request) IsIdempotent() bool + func (r *Request) OnFailed(f func(r *Request)) + func (r *Request) OnFinished(f func(r *Request)) + func (r *Request) OnShouldStart(f func(r *Request) error) + func (r *Request) OnStarted(f func(r *Request)) + func (r *Request) OnValidate(f func() error) + func (r *Request) StatusCode() int