http

package
v0.29.4-rc.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxAllowedRedirects = 10

Variables

View Source
var (
	//nolint:gochecknoglobals // following in the steps of the standard library
	DefaultClient = NewClient([]string{"github.com", "gitlab.com", "sighup.io"})

	ErrNoRequest                   = errors.New("no request")
	ErrMaxAllowedRedirectsExceeded = errors.New("maximum number of allowed redirects exceeded")
)
View Source
var ErrCannotDownloadFile = errors.New("cannot download file")

Functions

func DownloadFile

func DownloadFile(url string) (string, error)

func NewClient

func NewClient(allowedDomains []string) *http.Client

NewClient instantiate a safer HTTP Client that only allows certain redirects.

Types

This section is empty.

Jump to

Keyboard shortcuts

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