Documentation ¶
Index ¶
- Constants
- func NewHTTPSignatureBuilder() *hTTPSignatureBuilder
- type Algorithm
- type Authorization
- type Basic
- type Bearer
- type ContentType
- type HTTPSignature
- type HttpClient
- func (h *HttpClient) Accept(accept ContentType) HttpIntegration
- func (h *HttpClient) AddHeader(key string, value string) HttpIntegration
- func (h *HttpClient) AddParams(key string, value string) HttpIntegration
- func (h *HttpClient) AddQuery(key string, value string) HttpIntegration
- func (h *HttpClient) Authorization(authorization Authorization) HttpIntegration
- func (h *HttpClient) Body(body []byte) HttpIntegration
- func (h *HttpClient) BodyJson(body any) HttpIntegration
- func (h *HttpClient) ContentType(contentType ContentType) HttpIntegration
- func (h *HttpClient) Exec() HttpClientResponse
- func (h *HttpClient) Interceptor(interceptor http.RoundTripper) HttpIntegration
- func (h *HttpClient) Timeout(timeout time.Duration) HttpIntegration
- func (h *HttpClient) TimeoutDuration(timeoutDuration time.Duration) HttpIntegration
- func (h *HttpClient) WithContext(ctx context.Context) HttpIntegration
- type HttpClientMethod
- type HttpClientResponse
- type HttpIntegration
- type HttpMethod
- type HttpRestClientResponse
- type RestClient
- type SHA256
Constants ¶
View Source
const AcceptDescription = "Accept"
View Source
const ContentTypeDescription = "Content-Type"
Variables ¶
This section is empty.
Functions ¶
func NewHTTPSignatureBuilder ¶ added in v1.0.4
func NewHTTPSignatureBuilder() *hTTPSignatureBuilder
Types ¶
type Algorithm ¶ added in v1.0.12
type Authorization ¶
func NewBasic ¶
func NewBasic(username string, password string) Authorization
func NewBearer ¶
func NewBearer(token string) Authorization
type Basic ¶
type Basic struct {
// contains filtered or unexported fields
}
func (Basic) GetAuthorization ¶
func (Basic) GetHeaderKey ¶ added in v1.0.4
type Bearer ¶
type Bearer struct {
// contains filtered or unexported fields
}
func (Bearer) GetAuthorization ¶
func (Bearer) GetHeaderKey ¶ added in v1.0.4
type ContentType ¶
type ContentType string
const ( ApplicationJson ContentType = "application/json" FormEncoded ContentType = "application/x-www-form-urlencoded" )
type HTTPSignature ¶ added in v1.0.4
func (HTTPSignature) GetAuthorization ¶ added in v1.0.4
func (s HTTPSignature) GetAuthorization() string
func (HTTPSignature) GetHeaderKey ¶ added in v1.0.4
func (s HTTPSignature) GetHeaderKey() string
type HttpClient ¶ added in v1.0.2
type HttpClient struct {
// contains filtered or unexported fields
}
func (*HttpClient) Accept ¶ added in v1.0.2
func (h *HttpClient) Accept(accept ContentType) HttpIntegration
func (*HttpClient) AddHeader ¶ added in v1.0.2
func (h *HttpClient) AddHeader(key string, value string) HttpIntegration
func (*HttpClient) AddParams ¶ added in v1.0.2
func (h *HttpClient) AddParams(key string, value string) HttpIntegration
func (*HttpClient) AddQuery ¶ added in v1.0.2
func (h *HttpClient) AddQuery(key string, value string) HttpIntegration
func (*HttpClient) Authorization ¶ added in v1.0.2
func (h *HttpClient) Authorization(authorization Authorization) HttpIntegration
func (*HttpClient) Body ¶ added in v1.0.2
func (h *HttpClient) Body(body []byte) HttpIntegration
func (*HttpClient) BodyJson ¶ added in v1.1.1
func (h *HttpClient) BodyJson(body any) HttpIntegration
func (*HttpClient) ContentType ¶ added in v1.0.2
func (h *HttpClient) ContentType(contentType ContentType) HttpIntegration
func (*HttpClient) Exec ¶ added in v1.0.2
func (h *HttpClient) Exec() HttpClientResponse
func (*HttpClient) Interceptor ¶ added in v1.0.2
func (h *HttpClient) Interceptor(interceptor http.RoundTripper) HttpIntegration
func (*HttpClient) Timeout ¶ added in v1.1.0
func (h *HttpClient) Timeout(timeout time.Duration) HttpIntegration
func (*HttpClient) TimeoutDuration ¶ added in v1.1.0
func (h *HttpClient) TimeoutDuration(timeoutDuration time.Duration) HttpIntegration
func (*HttpClient) WithContext ¶ added in v1.1.7
func (h *HttpClient) WithContext(ctx context.Context) HttpIntegration
type HttpClientMethod ¶
type HttpClientMethod interface { // Post executes a single HTTP POST transaction, returning // // url is the url, host, or path of the request Post(url ...string) HttpIntegration // Put executes a single HTTP POST transaction, returning // // url is the url, host, or path of the request Put(url ...string) HttpIntegration // Get executes a single HTTP POST transaction, returning // // url is the url, host, or path of the request Get(url ...string) HttpIntegration // Delete executes a single HTTP POST transaction, returning // // url is the url, host, or path of the request Delete(url ...string) HttpIntegration }
func NewRestClient ¶
func NewRestClient() HttpClientMethod
type HttpClientResponse ¶ added in v1.0.1
type HttpClientResponse interface { GetBody() ([]byte, error) Unmarshal(response any) error GetResponse() *http.Response GetError() error }
func NewHttpRestClientResponse ¶ added in v1.0.1
func NewHttpRestClientResponse(response *http.Response, err error) HttpClientResponse
type HttpIntegration ¶
type HttpIntegration interface { ContentType(contentType ContentType) HttpIntegration Accept(accept ContentType) HttpIntegration Authorization(authorization Authorization) HttpIntegration Timeout(timeout time.Duration) HttpIntegration TimeoutDuration(timeoutDuration time.Duration) HttpIntegration AddHeader(key string, value string) HttpIntegration AddParams(key string, value string) HttpIntegration AddQuery(key string, value string) HttpIntegration Interceptor(interceptor http.RoundTripper) HttpIntegration Body(body []byte) HttpIntegration BodyJson(body any) HttpIntegration WithContext(ctx context.Context) HttpIntegration Exec() HttpClientResponse }
type HttpMethod ¶
type HttpMethod string
const ( Post HttpMethod = "POST" Put HttpMethod = "PUT" Get HttpMethod = "GET" Delete HttpMethod = "DELETE" )
type HttpRestClientResponse ¶ added in v1.0.1
type HttpRestClientResponse struct {
// contains filtered or unexported fields
}
func (*HttpRestClientResponse) GetBody ¶ added in v1.0.1
func (h *HttpRestClientResponse) GetBody() (body []byte, err error)
func (*HttpRestClientResponse) GetError ¶ added in v1.0.1
func (h *HttpRestClientResponse) GetError() error
func (*HttpRestClientResponse) GetResponse ¶ added in v1.0.1
func (h *HttpRestClientResponse) GetResponse() *http.Response
func (*HttpRestClientResponse) Unmarshal ¶ added in v1.1.0
func (h *HttpRestClientResponse) Unmarshal(objectToConvert any) error
type RestClient ¶
type RestClient struct { }
func (*RestClient) Delete ¶
func (r *RestClient) Delete(url ...string) HttpIntegration
func (*RestClient) Get ¶
func (r *RestClient) Get(url ...string) HttpIntegration
func (*RestClient) Post ¶
func (r *RestClient) Post(url ...string) HttpIntegration
func (*RestClient) Put ¶ added in v1.0.4
func (r *RestClient) Put(url ...string) HttpIntegration
Click to show internal directories.
Click to hide internal directories.