package
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: May 14, 2025
License: GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
http_client
HTTP client implementation that provides standardized web request handling for external API communication.
Notes
- Implements a reusable HTTP client for making external API requests
- Handles common HTTP operations (GET, POST, etc.)
- Includes proper error handling and request timeouts
- Supports response parsing and deserialization
- Provides a mock client implementation for testing
- Follows Go's context patterns for request cancellation
- Makes external service dependencies testable through interfaces
- Implements proper connection management and reuse
Documentation
¶
type DefaultHTTPClient struct{}
DefaultHTTPClient is the default implementation of HTTPClient.
Post makes an HTTP POST request.
HTTPClient is an interface for making HTTP requests.
NewHTTPClient creates a new HTTPClient.
type MockHTTPClient struct {
mock.Mock
}
MockHTTPClient is a mock implementation of HTTPClient.
Post makes an HTTP POST request.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.