Documentation ¶
Index ¶
- Constants
- func NewConnectionRefusedError(code int, err error) error
- func NewHttpError(code int, err error) error
- func NewServiceUnreachableError(code int, message string) error
- type BreakError
- type Client
- type ConnectionRefusedError
- type HttpClient
- func (c *HttpClient) Get(url string, args map[string]any, headers map[string]string) ([]byte, map[string]string, int, error)
- func (c *HttpClient) Post(url string, args map[string]any, headers map[string]string) ([]byte, map[string]string, int, error)
- func (c *HttpClient) SkipTlsVerify() *HttpClient
- func (c *HttpClient) WithBasicAuth(login, password string) *HttpClient
- func (c *HttpClient) WithBearerAuth(token string) *HttpClient
- func (c *HttpClient) WithBreaker(failureThreshold uint, initial, max time.Duration) *HttpClient
- func (c *HttpClient) WithNoAuth() *HttpClient
- func (c *HttpClient) WithRetry(retries uint, delay time.Duration) *HttpClient
- func (c *HttpClient) WithTimeout(timeout time.Duration) *HttpClient
- type HttpError
- type ServiceCall
- type ServiceUnreachableError
Constants ¶
View Source
const ( HttpClientUnknownError = int(httpClientUnknownError) HttpClientMarshallingError = int(httpClientMarshallingError) HttpClientConnectionRefusedError = int(httpClientConnectionRefusedError) HttpClientRetriesExhaustedError = int(httpClientRetriesExhaustedError) HttpClientHoSuchHostError = int(httpClientHoSuchHostError) )
Variables ¶
This section is empty.
Functions ¶
func NewConnectionRefusedError ¶ added in v0.0.4
func NewHttpError ¶
func NewServiceUnreachableError ¶ added in v0.0.4
Types ¶
type BreakError ¶
func (BreakError) Error ¶
func (be BreakError) Error() string
type ConnectionRefusedError ¶ added in v0.0.4
type ConnectionRefusedError struct {
// contains filtered or unexported fields
}
func (*ConnectionRefusedError) Code ¶ added in v0.0.4
func (e *ConnectionRefusedError) Code() int
func (*ConnectionRefusedError) Error ¶ added in v0.0.4
func (e *ConnectionRefusedError) Error() string
func (*ConnectionRefusedError) Is ¶ added in v0.0.4
func (e *ConnectionRefusedError) Is(tgt error) bool
type HttpClient ¶ added in v0.0.6
type HttpClient struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.0.7
func New() *HttpClient
func (*HttpClient) SkipTlsVerify ¶ added in v0.0.7
func (c *HttpClient) SkipTlsVerify() *HttpClient
func (*HttpClient) WithBasicAuth ¶ added in v0.0.8
func (c *HttpClient) WithBasicAuth(login, password string) *HttpClient
func (*HttpClient) WithBearerAuth ¶ added in v0.0.8
func (c *HttpClient) WithBearerAuth(token string) *HttpClient
func (*HttpClient) WithBreaker ¶ added in v0.0.6
func (c *HttpClient) WithBreaker(failureThreshold uint, initial, max time.Duration) *HttpClient
func (*HttpClient) WithNoAuth ¶ added in v0.0.8
func (c *HttpClient) WithNoAuth() *HttpClient
func (*HttpClient) WithRetry ¶ added in v0.0.6
func (c *HttpClient) WithRetry(retries uint, delay time.Duration) *HttpClient
func (*HttpClient) WithTimeout ¶ added in v0.0.6
func (c *HttpClient) WithTimeout(timeout time.Duration) *HttpClient
type ServiceCall ¶
type ServiceUnreachableError ¶ added in v0.0.4
type ServiceUnreachableError struct {
// contains filtered or unexported fields
}
func (*ServiceUnreachableError) Code ¶ added in v0.0.4
func (e *ServiceUnreachableError) Code() int
func (*ServiceUnreachableError) Error ¶ added in v0.0.4
func (e *ServiceUnreachableError) Error() string
func (*ServiceUnreachableError) Is ¶ added in v0.0.4
func (e *ServiceUnreachableError) Is(tgt error) bool
Click to show internal directories.
Click to hide internal directories.