Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
ClientConfig defines configuration for the HTTP client.
func NewClientConfig ¶
func NewClientConfig() *ClientConfig
NewClientConfig creates a default client configuration.
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient wraps http.Client and includes additional configuration.
func NewHTTPClient ¶
func NewHTTPClient(config *ClientConfig) *HTTPClient
NewHTTPClient creates a new HTTPClient with the provided configuration.
func (*HTTPClient) Get ¶
func (c *HTTPClient) Get(url string) ([]byte, error)
Get performs a HTTP GET request and returns the response body.
func (*HTTPClient) Post ¶
func (c *HTTPClient) Post(ctx context.Context, url string, headers map[string]string, data any) ([]byte, error)
Post sends a JSON-encoded POST request and returns the response body.
func (*HTTPClient) PostReturn ¶
func (c *HTTPClient) PostReturn(ctx context.Context, url string, headers map[string]string, input, output any) error
PostReturn sends a JSON-encoded POST request and decodes the JSON response into the output parameter.
Click to show internal directories.
Click to hide internal directories.