web

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrainAndClose

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 GetRateLimiter

func GetRateLimiter(name string, newRateLimit int) *ratelimit.Limiter

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 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