http

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: AGPL-3.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HTTP_METHOD_GET                    = "GET"
	HTTP_METHOD_POST                   = "POST"
	HTTP_METHOD_PUT                    = "PUT"
	HTTP_METHOD_DELETE                 = "DELETE"
	HTTP_METHOD_HEAD                   = "HEAD"
	HTTP_METHOD_PATCH                  = "PATCH"
	HTTP_METHOD_OPTIONS                = "OPTIONS"
	OCSP_STATUS_GOOD                   = "good"
	OCSP_STATUS_REVOKED                = "revoked"
	OCSP_STATUS_SERVER_FAILED          = "server_failed"
	OCSP_STATUS_UNKNOWN                = "unknown"
	OCSP_REASON_UNSPECIFIED            = "unspecified"
	OCSP_REASON_KEY_COMPROMISE         = "key_compromise"
	OCSP_REASON_CA_COMPROMISE          = "ca_compromise"
	OCSP_REASON_AFFILIATION_CHANGED    = "affiliation_changed"
	OCSP_REASON_SUPERSEDED             = "superseded"
	OCSP_REASON_CESSATION_OF_OPERATION = "cessation_of_operation"
	OCSP_REASON_CERTIFICATE_HOLD       = "certificate_hold"
	OCSP_REASON_REMOVE_FROM_CRL        = "remove_from_crl"
	OCSP_REASON_PRIVILEGE_WITHDRAWN    = "privilege_withdrawn"
	OCSP_REASON_AA_COMPROMISE          = "aa_compromise"
	SSL_3_0                            = "ssl3.0"
	TLS_1_0                            = "tls1.0"
	TLS_1_1                            = "tls1.1"
	TLS_1_2                            = "tls1.2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP struct {
	SSL_3_0                            string `js:"SSL_3_0"`
	TLS_1_0                            string `js:"TLS_1_0"`
	TLS_1_1                            string `js:"TLS_1_1"`
	TLS_1_2                            string `js:"TLS_1_2"`
	OCSP_STATUS_GOOD                   string `js:"OCSP_STATUS_GOOD"`
	OCSP_STATUS_REVOKED                string `js:"OCSP_STATUS_REVOKED"`
	OCSP_STATUS_SERVER_FAILED          string `js:"OCSP_STATUS_SERVER_FAILED"`
	OCSP_STATUS_UNKNOWN                string `js:"OCSP_STATUS_UNKNOWN"`
	OCSP_REASON_UNSPECIFIED            string `js:"OCSP_REASON_UNSPECIFIED"`
	OCSP_REASON_KEY_COMPROMISE         string `js:"OCSP_REASON_KEY_COMPROMISE"`
	OCSP_REASON_CA_COMPROMISE          string `js:"OCSP_REASON_CA_COMPROMISE"`
	OCSP_REASON_AFFILIATION_CHANGED    string `js:"OCSP_REASON_AFFILIATION_CHANGED"`
	OCSP_REASON_SUPERSEDED             string `js:"OCSP_REASON_SUPERSEDED"`
	OCSP_REASON_CESSATION_OF_OPERATION string `js:"OCSP_REASON_CESSATION_OF_OPERATION"`
	OCSP_REASON_CERTIFICATE_HOLD       string `js:"OCSP_REASON_CERTIFICATE_HOLD"`
	OCSP_REASON_REMOVE_FROM_CRL        string `js:"OCSP_REASON_REMOVE_FROM_CRL"`
	OCSP_REASON_PRIVILEGE_WITHDRAWN    string `js:"OCSP_REASON_PRIVILEGE_WITHDRAWN"`
	OCSP_REASON_AA_COMPROMISE          string `js:"OCSP_REASON_AA_COMPROMISE"`
}

func New added in v0.18.0

func New() *HTTP

func (*HTTP) Batch

func (http *HTTP) Batch(ctx context.Context, reqsV goja.Value) (goja.Value, error)

func (*HTTP) CookieJar added in v0.18.0

func (*HTTP) CookieJar(ctx context.Context) *HTTPCookieJar

func (*HTTP) Del

func (http *HTTP) Del(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Get

func (http *HTTP) Get(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Head

func (http *HTTP) Head(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Options added in v0.19.0

func (http *HTTP) Options(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Patch

func (http *HTTP) Patch(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Post

func (http *HTTP) Post(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Put

func (http *HTTP) Put(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Request

func (http *HTTP) Request(ctx context.Context, method string, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Url added in v0.16.0

func (http *HTTP) Url(parts []string, pieces ...string) (URL, error)

func (*HTTP) XCookieJar added in v0.18.0

func (*HTTP) XCookieJar(ctx *context.Context) *HTTPCookieJar

type HTTPCookie added in v0.18.0

type HTTPCookie struct {
	Name, Value, Domain, Path string
	HttpOnly, Secure          bool
	MaxAge                    int
	Expires                   int64
}

type HTTPCookieJar added in v0.18.0

type HTTPCookieJar struct {
	// contains filtered or unexported fields
}

func (HTTPCookieJar) CookiesForURL added in v0.18.0

func (j HTTPCookieJar) CookiesForURL(url string) map[string][]string

func (HTTPCookieJar) Set added in v0.18.0

func (j HTTPCookieJar) Set(url, name, value string, opts goja.Value) (bool, error)

type HTTPRequestCookie added in v0.18.0

type HTTPRequestCookie struct {
	Name, Value string
	Replace     bool
}

type HTTPResponse

type HTTPResponse struct {
	RemoteIP       string
	RemotePort     int
	URL            string
	Status         int
	Proto          string
	Headers        map[string]string
	Cookies        map[string][]*HTTPCookie
	Body           string
	Timings        HTTPResponseTimings
	TLSVersion     string
	TLSCipherSuite string
	OCSP           OCSP `js:"ocsp"`
	Error          string
	// contains filtered or unexported fields
}
func (res *HTTPResponse) ClickLink(args ...goja.Value) (*HTTPResponse, error)

func (*HTTPResponse) Html

func (res *HTTPResponse) Html(selector ...string) html.Selection

func (*HTTPResponse) Json

func (res *HTTPResponse) Json() goja.Value

func (*HTTPResponse) SubmitForm added in v0.19.0

func (res *HTTPResponse) SubmitForm(args ...goja.Value) (*HTTPResponse, error)

type HTTPResponseTimings

type HTTPResponseTimings struct {
	Duration, Blocked, LookingUp, Connecting, TLSHandshaking, Sending, Waiting, Receiving float64
}

type MultiSlotLimiter added in v0.19.0

type MultiSlotLimiter struct {
	// contains filtered or unexported fields
}

func NewMultiSlotLimiter added in v0.19.0

func NewMultiSlotLimiter(slots int) MultiSlotLimiter

func (*MultiSlotLimiter) Slot added in v0.19.0

func (l *MultiSlotLimiter) Slot(s string) *SlotLimiter

type OCSP added in v0.18.0

type OCSP struct {
	ProducedAt, ThisUpdate, NextUpdate, RevokedAt int64
	RevocationReason                              string
	Status                                        string
}

type SlotLimiter added in v0.18.2

type SlotLimiter struct {
	// contains filtered or unexported fields
}

func NewSlotLimiter added in v0.18.2

func NewSlotLimiter(slots int) SlotLimiter

func (*SlotLimiter) Begin added in v0.18.2

func (l *SlotLimiter) Begin()

func (*SlotLimiter) End added in v0.18.2

func (l *SlotLimiter) End()

type URL added in v0.18.2

type URL struct {
	URL       *url.URL `js:"-"`
	Name      string   `js:"name"` // http://example.com/thing/${}/
	URLString string   `js:"url"`  // http://example.com/thing/1234/
}

A URL wraps net.URL, and preserves the template (if any) the URL was constructed from.

func ToURL added in v0.18.2

func ToURL(v goja.Value) (URL, error)

Jump to

Keyboard shortcuts

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