vgo: Index | Files

package web

import ""

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


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

Package web imports 10 packages (graph). Updated 2018-10-02. Refresh now. Tools for package owners.