Documentation
¶
Index ¶
- type Config
- func (c *Config) Delete(url string) *Config
- func (c *Config) Do() (Response, error)
- func (c *Config) Get(url string, whitelist, blacklist []string) *Config
- func (c *Config) Patch(url string) *Config
- func (c *Config) Post(url string) *Config
- func (c *Config) Put(url string) *Config
- func (c *Config) SendFile(key, filename string, file []byte) *Config
- func (c *Config) SendFormData(fd map[string]string) *Config
- func (c *Config) SendJSON(j map[string]interface{}) *Config
- func (c *Config) WithCookie(cookies map[string]string) *Config
- func (c *Config) WithFailRetry(interval time.Duration, attempt int) *Config
- func (c *Config) WithHeader(headers map[string]string) *Config
- func (c *Config) WithTimeout(second time.Duration) *Config
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config to set the configuration to calling an HTTP.
func (*Config) Do ¶
Do to running an HTTP call. Response header and cookies can be returned if only use 1 call HTTP.
func (*Config) Get ¶
Get to set HTTP GET method. For the GET method, you can call this function more than 1, to merging the response body. You can use whitelist and blacklist args to filtering the response body. Whitelist to get field value from response body. Blacklist to ignore the field from response body.
func (*Config) SendFormData ¶
SendFormData to send multipart/form-data with POST, PUT or PATCH method.
func (*Config) WithCookie ¶
WithCookie to send HTTP cookies.
func (*Config) WithFailRetry ¶
WithFailRetry to retrying if HTTP call fails. Use 2 argument interval and attempt. interval args in miliseconds. attempt args is int how much to retry HTTP calls.
func (*Config) WithHeader ¶
WithHeader to set HTTP headers.