Documentation ¶
Index ¶
- type APIRequest
- type APIRequestBuilder
- type APIRequestOption
- func WithAccept(value string) APIRequestOption
- func WithAuthorizationBearer(token string) APIRequestOption
- func WithBody(body interface{}) APIRequestOption
- func WithContentType(value string) APIRequestOption
- func WithContentTypeJson() APIRequestOption
- func WithDebug() APIRequestOption
- func WithForceHttp11() APIRequestOption
- func WithHeader(key, value string) APIRequestOption
- func WithMethod(method string) APIRequestOption
- func WithMethodDelete() APIRequestOption
- func WithMethodGet() APIRequestOption
- func WithMethodPost() APIRequestOption
- func WithMethodPut() APIRequestOption
- func WithPath(path string) APIRequestOption
- func WithQuery(params map[string]string) APIRequestOption
- type APIResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIRequest ¶
type APIRequest struct {
// contains filtered or unexported fields
}
func (*APIRequest) Execute ¶
func (request *APIRequest) Execute() (*APIResponse, error)
type APIRequestBuilder ¶
type APIRequestBuilder struct {
// contains filtered or unexported fields
}
func NewAPIRequestBuilder ¶
func NewAPIRequestBuilder(baseUrl string, options ...APIRequestOption) (*APIRequestBuilder, error)
func (*APIRequestBuilder) Build ¶
func (builder *APIRequestBuilder) Build() *APIRequest
func (*APIRequestBuilder) WithHeader ¶
func (opts *APIRequestBuilder) WithHeader(key, value string)
func (*APIRequestBuilder) WithQuery ¶
func (opts *APIRequestBuilder) WithQuery(params map[string]string)
type APIRequestOption ¶
type APIRequestOption func(*APIRequest)
func WithAccept ¶
func WithAccept(value string) APIRequestOption
func WithAuthorizationBearer ¶
func WithAuthorizationBearer(token string) APIRequestOption
func WithBody ¶
func WithBody(body interface{}) APIRequestOption
func WithContentType ¶
func WithContentType(value string) APIRequestOption
func WithContentTypeJson ¶
func WithContentTypeJson() APIRequestOption
func WithDebug ¶
func WithDebug() APIRequestOption
func WithForceHttp11 ¶
func WithForceHttp11() APIRequestOption
func WithHeader ¶
func WithHeader(key, value string) APIRequestOption
func WithMethod ¶
func WithMethod(method string) APIRequestOption
func WithMethodDelete ¶
func WithMethodDelete() APIRequestOption
func WithMethodGet ¶
func WithMethodGet() APIRequestOption
func WithMethodPost ¶
func WithMethodPost() APIRequestOption
func WithMethodPut ¶
func WithMethodPut() APIRequestOption
func WithPath ¶
func WithPath(path string) APIRequestOption
func WithQuery ¶
func WithQuery(params map[string]string) APIRequestOption
type APIResponse ¶
func (*APIResponse) String ¶
func (resp *APIResponse) String() string
func (*APIResponse) UnmarshalJSONTo ¶
func (resp *APIResponse) UnmarshalJSONTo(target interface{}) error
Click to show internal directories.
Click to hide internal directories.