Documentation
¶
Overview ¶
Package holyapi provides client for interacting with other Holyheld services over HTTP
Index ¶
- func ExtractUserAgent(ctx context.Context) string
- func ExtractVia(ctx context.Context) string
- func ProvideUserAgent(ua string) func(http.Handler) http.Handler
- func ProvideVia(pseudonym string) func(http.Handler) http.Handler
- type Client
- func (c *Client) Request(ctx context.Context, method string, path string, header http.Header, body any, ...) (int, error)
- func (c *Client) RequestWithOptions(ctx context.Context, method string, path string, body any, successResponse any, ...) (int, error)
- func (c *Client) RequestWithRetry(ctx context.Context, method string, path string, header http.Header, body any, ...) (int, error)
- type NonContractResponseError
- type Option
- type ResponseError
- type ResponseMeta
- type ResponseSuccess
- type Status
- type UnexpectedError
- type UnexpectedStatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractUserAgent ¶
func ExtractVia ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) RequestWithOptions ¶ added in v1.0.8
type NonContractResponseError ¶
type NonContractResponseError struct {
// contains filtered or unexported fields
}
func NewNonContractResponseError ¶
func NewNonContractResponseError(status int, cause error) *NonContractResponseError
func (*NonContractResponseError) Error ¶
func (e *NonContractResponseError) Error() string
func (*NonContractResponseError) Is ¶
func (e *NonContractResponseError) Is(target error) bool
func (*NonContractResponseError) LogValue ¶
func (e *NonContractResponseError) LogValue() slog.Value
func (*NonContractResponseError) Unwrap ¶
func (e *NonContractResponseError) Unwrap() error
type ResponseError ¶
type ResponseError struct {
Status Status `json:"status"`
ErrorDescription string `json:"error"`
ErrorCode string `json:"errorCode"`
Payload json.RawMessage `json:"payload,omitempty"`
Meta ResponseMeta `json:"-"`
}
func (*ResponseError) Error ¶
func (r *ResponseError) Error() string
func (*ResponseError) LogValue ¶
func (r *ResponseError) LogValue() slog.Value
type ResponseMeta ¶
type ResponseSuccess ¶
type UnexpectedError ¶
type UnexpectedError struct {
// contains filtered or unexported fields
}
func NewUnexpectedError ¶
func NewUnexpectedError(status int, cause *ResponseError) *UnexpectedError
func (*UnexpectedError) Error ¶
func (e *UnexpectedError) Error() string
func (*UnexpectedError) Is ¶
func (e *UnexpectedError) Is(target error) bool
func (*UnexpectedError) LogValue ¶
func (e *UnexpectedError) LogValue() slog.Value
func (*UnexpectedError) Unwrap ¶
func (e *UnexpectedError) Unwrap() error
type UnexpectedStatusError ¶
type UnexpectedStatusError struct {
// contains filtered or unexported fields
}
func NewUnexpectedStatusError ¶
func NewUnexpectedStatusError(status int) *UnexpectedStatusError
func (*UnexpectedStatusError) Error ¶
func (e *UnexpectedStatusError) Error() string
func (*UnexpectedStatusError) LogValue ¶
func (e *UnexpectedStatusError) LogValue() slog.Value
Click to show internal directories.
Click to hide internal directories.