Documentation ¶
Index ¶
- func Decode[T any](r io.Reader) (*T, error)
- func DecodeList[T any](r io.Reader) ([]T, error)
- func DecodeMap[R comparable, T any](r io.Reader) (map[R]T, error)
- func LoadCerts(path string) (*x509.CertPool, error)
- func NewHTTPClient() *http.Client
- func NewLoggingRoundTripper(roundTripper http.RoundTripper) http.RoundTripper
- type BasicAuth
- type Client
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Fetch(ctx context.Context, api string) (*http.Response, error)
- func (c *Client) Get(ctx context.Context, path string, query url.Values) (*http.Response, error)
- func (c *Client) Post(ctx context.Context, path string, payload any) (*http.Response, error)
- type ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func NewLoggingRoundTripper ¶
func NewLoggingRoundTripper(roundTripper http.RoundTripper) http.RoundTripper
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(options []ClientOption) (*Client, error)
type ClientOption ¶
func WithBaseAuth ¶
func WithBaseAuth(auth BasicAuth) ClientOption
func WithBaseURL ¶
func WithBaseURL(url string) ClientOption
func WithCertificate ¶
func WithCertificate(path string) ClientOption
func WithLogging ¶
func WithLogging() ClientOption
func WithSkipTLS ¶
func WithSkipTLS() ClientOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.