web

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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

func GetResponse(method HTTPMethod, requestUrl string, timeout int, v ...interface{}) (*req.Resp, error)

func JoinURL

func JoinURL(base string, paths ...string) string

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 Option added in v1.7.0

type Option int
const (
	WithNoRedirect Option = iota + 1
)

type RateLimitCallback added in v1.8.0

type RateLimitCallback func(rl *rate.Limiter) error

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

type Retry

type Retry struct {
	backoff.Backoff
	MaxAttempts          float64
	RetryableStatusCodes []int
	ExpectedContentType  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL