Documentation ¶
Index ¶
- func DrainAndClose(rc io.ReadCloser)
- func GetBodyBytes(method HTTPMethod, requestUrl string, timeout int, v ...interface{}) ([]byte, error)
- func GetBodyString(method HTTPMethod, requestUrl string, timeout int, v ...interface{}) (string, error)
- func GetResponse(method HTTPMethod, requestUrl string, timeout int, v ...interface{}) (*req.Resp, error)
- func JoinURL(base string, paths ...string) string
- type HTTPMethod
- type Option
- type RateLimitCallback
- type RateLimiter
- type Retry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrainAndClose ¶ added in v1.5.3
func DrainAndClose(rc io.ReadCloser)
func GetBodyBytes ¶
func GetBodyBytes(method HTTPMethod, requestUrl string, timeout int, v ...interface{}) ([]byte, error)
func GetBodyString ¶
func GetBodyString(method HTTPMethod, requestUrl string, timeout int, v ...interface{}) (string, error)
func GetResponse ¶
Types ¶
type HTTPMethod ¶
type HTTPMethod int
HTTPMethod - The HTTP request method to use
const ( // GET - Use GET HTTP method GET HTTPMethod = iota + 1 // POST - Use POST HTTP method POST // PUT - Use PUT HTTP method PUT // DELETE - Use DELETE HTTP method DELETE )
type RateLimitCallback ¶ added in v1.8.0
type RateLimiter ¶ added in v1.8.0
type RateLimiter struct { Take func(rl *rate.Limiter) error // contains filtered or unexported fields }
func GetRateLimiter ¶ added in v1.7.0
func GetRateLimiter(name string, limit int, duration time.Duration, burst int, check RateLimitCallback) *RateLimiter
Click to show internal directories.
Click to hide internal directories.