Documentation
¶
Index ¶
- func IsHTTPAgentErrorStatusOf(err error, status int) (*types.AgentError, bool)
- func NewAuthenticatedTransport(base http.RoundTripper, auth auth.AuthMethod) http.RoundTripper
- func NewTransport() *http.Transport
- type AuthenticatedTransport
- type HTTPClient
- type HTTPClientWithBearerAuthFactory
- type HTTPError
- type MockHTTPClient
- func (m *MockHTTPClient) Delete(path string, log logging.Logger) error
- func (m *MockHTTPClient) Get(path string, into any, log logging.Logger) error
- func (m *MockHTTPClient) GetRaw(path string, log logging.Logger) ([]byte, error)
- func (m *MockHTTPClient) Patch(path string, body any, into any, log logging.Logger) error
- func (m *MockHTTPClient) Post(path string, body any, into any, log logging.Logger) error
- func (m *MockHTTPClient) PostForm(path string, data url.Values, into any, log logging.Logger) error
- func (m *MockHTTPClient) PostRaw(path string, body io.Reader, bodyType string, log logging.Logger) ([]byte, error)
- func (m *MockHTTPClient) Put(path string, body any, into any, log logging.Logger) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsHTTPAgentErrorStatusOf ¶ added in v1.2.0
func IsHTTPAgentErrorStatusOf(err error, status int) (*types.AgentError, bool)
func NewAuthenticatedTransport ¶
func NewAuthenticatedTransport(base http.RoundTripper, auth auth.AuthMethod) http.RoundTripper
func NewTransport ¶ added in v1.19.0
Types ¶
type AuthenticatedTransport ¶
type AuthenticatedTransport struct {
// contains filtered or unexported fields
}
type HTTPClient ¶
type HTTPClient interface {
GetRaw(path string, log logging.Logger) ([]byte, error)
PostRaw(path string, body io.Reader, bodyType string, log logging.Logger) ([]byte, error)
Get(path string, into any, log logging.Logger) error
Post(path string, body any, into any, log logging.Logger) error
PostForm(path string, data url.Values, into any, log logging.Logger) error
Put(path string, body any, into any, log logging.Logger) error
Patch(path string, body any, into any, log logging.Logger) error
Delete(path string, log logging.Logger) error
}
func NewBasicHTTPClient ¶ added in v1.18.1
func NewBasicHTTPClient(baseURL string, timeout time.Duration) HTTPClient
func NewBasicHTTPClientWithBearerAuth ¶ added in v1.19.0
func NewBasicHTTPClientWithBearerAuth(baseURL string, timeout time.Duration, authValue string) HTTPClient
func NewDefaultHTTPClient ¶
type HTTPClientWithBearerAuthFactory ¶ added in v1.19.0
type HTTPClientWithBearerAuthFactory func(baseURL string, timeout time.Duration, authValue string) HTTPClient
type HTTPError ¶
type MockHTTPClient ¶
func (*MockHTTPClient) Delete ¶
func (m *MockHTTPClient) Delete(path string, log logging.Logger) error
Click to show internal directories.
Click to hide internal directories.