Go: cmd/go/internal/web Index | Files

package web

import "cmd/go/internal/web"

Package web defines helper routines for accessing HTTP/HTTPS resources.

Index

Package Files

http.go security.go

func Get Uses

func Get(url string) ([]byte, error)

Get returns the data from an HTTP GET request for the given URL.

func GetMaybeInsecure Uses

func GetMaybeInsecure(importPath string, security SecurityMode) (urlStr string, body io.ReadCloser, err error)

GetMaybeInsecure returns the body of either the importPath's https resource or, if unavailable and permitted by the security mode, the http resource.

func OpenBrowser Uses

func OpenBrowser(url string) bool

func QueryEscape Uses

func QueryEscape(s string) string

type HTTPError Uses

type HTTPError struct {
    StatusCode int
    // contains filtered or unexported fields
}

func (*HTTPError) Error Uses

func (e *HTTPError) Error() string

type SecurityMode Uses

type SecurityMode int

SecurityMode specifies whether a function should make network calls using insecure transports (eg, plain text HTTP). The zero value is "secure".

const (
    Secure SecurityMode = iota
    Insecure
)

Package web imports 10 packages (graph) and is imported by 11 packages. Updated 2019-03-15. Refresh now. Tools for package owners.