Versions in this module Expand all Collapse all v1 v1.0.1 May 31, 2023 v1.0.0 May 31, 2023 Changes in this version + const MethodGET + const MethodPOST + var ErrCreateRequest = errors.New("failed to create HTTP request") + var ErrEncodePayloadXML = errors.New("failed to encode XML object") + var ErrGetPayloadData = errors.New("failed to get payload data") + var ErrGetResponseBody = errors.New("failed to get response body") + var ErrRequest = errors.New("failed to send request") + var ErrSaveCookie = errors.New("failed to save cookies") + var ErrUnmarshalJSON = errors.New("failed to unmarshal JSON data") + var ErrUnmarshalXML = errors.New("failed to unmarshal XML data") + var ErrUnsupportedContentType = errors.New("unsupported response body content type") + var ErrUnsupportedValueType = errors.New("unsupported value type") + type AddHeaderTransport struct + T http.RoundTripper + func (adt *AddHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error) + type Client interface + Do func(req *http.Request) (*http.Response, error) + NewRequest func(method, url string, body io.Reader) (*http.Request, error) + Send func(request Request) (Result[R], error) + func NewClient(args ClientArgs) Client[R] + type ClientArgs struct + CookieJar CookieJar + type CookieJar interface + Save func() error + type MockClient struct + func NewMockClient(ctrl *gomock.Controller) *MockClient[R] + func (m *MockClient[R]) Do(req *http.Request) (*http.Response, error) + func (m *MockClient[R]) EXPECT() *MockClientMockRecorder[R] + func (m *MockClient[R]) NewRequest(method, url string, body io.Reader) (*http.Request, error) + func (m *MockClient[R]) Send(request Request) (Result[R], error) + type MockClientMockRecorder struct + func (mr *MockClientMockRecorder[R]) Do(req interface{}) *gomock.Call + func (mr *MockClientMockRecorder[R]) NewRequest(method, url, body interface{}) *gomock.Call + func (mr *MockClientMockRecorder[R]) Send(request interface{}) *gomock.Call + type MockCookieJar struct + func NewMockCookieJar(ctrl *gomock.Controller) *MockCookieJar + func (m *MockCookieJar) Cookies(u *url.URL) []*http.Cookie + func (m *MockCookieJar) EXPECT() *MockCookieJarMockRecorder + func (m *MockCookieJar) Save() error + func (m *MockCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie) + type MockCookieJarMockRecorder struct + func (mr *MockCookieJarMockRecorder) Cookies(u interface{}) *gomock.Call + func (mr *MockCookieJarMockRecorder) Save() *gomock.Call + func (mr *MockCookieJarMockRecorder) SetCookies(u, cookies interface{}) *gomock.Call + type Payload interface + type Request struct + Headers map[string]string + Method string + Payload Payload + ResponseFormat ResponseFormat + URL string + type ResponseFormat string + const DefaultUserAgent + const ResponseFormatJSON + const ResponseFormatXML + type Result struct + Data R + Headers map[string]string + StatusCode int + type URLPayload struct + Content map[string]interface{} + type XMLPayload struct + Content map[string]interface{}