webapi: github.com/gowebapi/webapi/fetch Index | Files | Directories

package fetch

import "github.com/gowebapi/webapi/fetch"

Package fetch defines requests, responses, and the process that binds them: fetching.

Source: Fetch Standard (https://fetch.spec.whatwg.org/) Source: Referrer Policy (https://w3c.github.io/webappsec-referrer-policy/)

Index

Package Files

doc.go fetch.go

type Headers Uses

type Headers struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: Headers

func HeadersFromJS Uses

func HeadersFromJS(value js.Wrapper) *Headers

HeadersFromJS is casting a js.Wrapper into Headers.

func NewHeaders Uses

func NewHeaders(init [][]*patch.ByteString) (_result *Headers)

func (*Headers) Append Uses

func (_this *Headers) Append(name *patch.ByteString, value *patch.ByteString)

func (*Headers) Delete Uses

func (_this *Headers) Delete(name *patch.ByteString)

func (*Headers) Entries Uses

func (_this *Headers) Entries() (_result *HeadersEntryIterator)

func (*Headers) ForEach Uses

func (_this *Headers) ForEach(callback *HeadersForEach, optionalThisForCallbackArgument interface{})

func (*Headers) Get Uses

func (_this *Headers) Get(name *patch.ByteString) (_result *patch.ByteString)

func (*Headers) Has Uses

func (_this *Headers) Has(name *patch.ByteString) (_result bool)

func (*Headers) JSValue Uses

func (_this *Headers) JSValue() js.Value

func (*Headers) Keys Uses

func (_this *Headers) Keys() (_result *HeadersKeyIterator)

func (*Headers) Set Uses

func (_this *Headers) Set(name *patch.ByteString, value *patch.ByteString)

func (*Headers) Values Uses

func (_this *Headers) Values() (_result *HeadersValueIterator)

type HeadersEntryIterator Uses

type HeadersEntryIterator struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: HeadersEntryIterator

func HeadersEntryIteratorFromJS Uses

func HeadersEntryIteratorFromJS(value js.Wrapper) *HeadersEntryIterator

HeadersEntryIteratorFromJS is casting a js.Wrapper into HeadersEntryIterator.

func (*HeadersEntryIterator) JSValue Uses

func (_this *HeadersEntryIterator) JSValue() js.Value

func (*HeadersEntryIterator) Next Uses

func (_this *HeadersEntryIterator) Next() (_result *HeadersEntryIteratorValue)

type HeadersEntryIteratorValue Uses

type HeadersEntryIteratorValue struct {
    Value []js.Value
    Done  bool
}

dictionary: HeadersEntryIteratorValue

func HeadersEntryIteratorValueFromJS Uses

func HeadersEntryIteratorValueFromJS(value js.Wrapper) *HeadersEntryIteratorValue

HeadersEntryIteratorValueFromJS is allocating a new HeadersEntryIteratorValue object and copy all values from input javascript object

func (*HeadersEntryIteratorValue) JSValue Uses

func (_this *HeadersEntryIteratorValue) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type HeadersForEach Uses

type HeadersForEach js.Func

HeadersForEach is a javascript function type.

Call Release() when done to release resouces allocated to this type.

func HeadersForEachToJS Uses

func HeadersForEachToJS(callback HeadersForEachFunc) *HeadersForEach

type HeadersForEachFunc Uses

type HeadersForEachFunc func(currentValue *patch.ByteString, currentIndex int, listObj *Headers)

callback: HeadersForEach

func HeadersForEachFromJS Uses

func HeadersForEachFromJS(_value js.Value) HeadersForEachFunc

type HeadersKeyIterator Uses

type HeadersKeyIterator struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: HeadersKeyIterator

func HeadersKeyIteratorFromJS Uses

func HeadersKeyIteratorFromJS(value js.Wrapper) *HeadersKeyIterator

HeadersKeyIteratorFromJS is casting a js.Wrapper into HeadersKeyIterator.

func (*HeadersKeyIterator) JSValue Uses

func (_this *HeadersKeyIterator) JSValue() js.Value

func (*HeadersKeyIterator) Next Uses

func (_this *HeadersKeyIterator) Next() (_result *HeadersKeyIteratorValue)

type HeadersKeyIteratorValue Uses

type HeadersKeyIteratorValue struct {
    Value *patch.ByteString
    Done  bool
}

dictionary: HeadersKeyIteratorValue

func HeadersKeyIteratorValueFromJS Uses

func HeadersKeyIteratorValueFromJS(value js.Wrapper) *HeadersKeyIteratorValue

HeadersKeyIteratorValueFromJS is allocating a new HeadersKeyIteratorValue object and copy all values from input javascript object

func (*HeadersKeyIteratorValue) JSValue Uses

func (_this *HeadersKeyIteratorValue) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type HeadersValueIterator Uses

type HeadersValueIterator struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: HeadersValueIterator

func HeadersValueIteratorFromJS Uses

func HeadersValueIteratorFromJS(value js.Wrapper) *HeadersValueIterator

HeadersValueIteratorFromJS is casting a js.Wrapper into HeadersValueIterator.

func (*HeadersValueIterator) JSValue Uses

func (_this *HeadersValueIterator) JSValue() js.Value

func (*HeadersValueIterator) Next Uses

func (_this *HeadersValueIterator) Next() (_result *HeadersValueIteratorValue)

type HeadersValueIteratorValue Uses

type HeadersValueIteratorValue struct {
    Value *patch.ByteString
    Done  bool
}

dictionary: HeadersValueIteratorValue

func HeadersValueIteratorValueFromJS Uses

func HeadersValueIteratorValueFromJS(value js.Wrapper) *HeadersValueIteratorValue

HeadersValueIteratorValueFromJS is allocating a new HeadersValueIteratorValue object and copy all values from input javascript object

func (*HeadersValueIteratorValue) JSValue Uses

func (_this *HeadersValueIteratorValue) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type PromiseResponse Uses

type PromiseResponse struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: Promise

func PromiseResponseFromJS Uses

func PromiseResponseFromJS(value js.Wrapper) *PromiseResponse

PromiseResponseFromJS is casting a js.Wrapper into PromiseResponse.

func (*PromiseResponse) Catch Uses

func (_this *PromiseResponse) Catch(onRejected *PromiseResponseOnRejected) (_result *PromiseResponse)

func (*PromiseResponse) Finally Uses

func (_this *PromiseResponse) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseResponse)

func (*PromiseResponse) JSValue Uses

func (_this *PromiseResponse) JSValue() js.Value

func (*PromiseResponse) Then Uses

func (_this *PromiseResponse) Then(onFulfilled *PromiseResponseOnFulfilled, onRejected *PromiseResponseOnRejected) (_result *PromiseResponse)

type PromiseResponseOnFulfilled Uses

type PromiseResponseOnFulfilled js.Func

PromiseResponseOnFulfilled is a javascript function type.

Call Release() when done to release resouces allocated to this type.

func PromiseResponseOnFulfilledToJS Uses

func PromiseResponseOnFulfilledToJS(callback PromiseResponseOnFulfilledFunc) *PromiseResponseOnFulfilled

type PromiseResponseOnFulfilledFunc Uses

type PromiseResponseOnFulfilledFunc func(value *Response)

callback: PromiseTemplateOnFulfilled

func PromiseResponseOnFulfilledFromJS Uses

func PromiseResponseOnFulfilledFromJS(_value js.Value) PromiseResponseOnFulfilledFunc

type PromiseResponseOnRejected Uses

type PromiseResponseOnRejected js.Func

PromiseResponseOnRejected is a javascript function type.

Call Release() when done to release resouces allocated to this type.

func PromiseResponseOnRejectedToJS Uses

func PromiseResponseOnRejectedToJS(callback PromiseResponseOnRejectedFunc) *PromiseResponseOnRejected

type PromiseResponseOnRejectedFunc Uses

type PromiseResponseOnRejectedFunc func(reason js.Value)

callback: PromiseTemplateOnRejected

func PromiseResponseOnRejectedFromJS Uses

func PromiseResponseOnRejectedFromJS(_value js.Value) PromiseResponseOnRejectedFunc

type ReferrerPolicy Uses

type ReferrerPolicy int

enum: ReferrerPolicy

const (
    EmptyString0ReferrerPolicy ReferrerPolicy = iota
    NoReferrerReferrerPolicy
    NoReferrerWhenDowngradeReferrerPolicy
    SameOriginReferrerPolicy
    OriginReferrerPolicy
    StrictOriginReferrerPolicy
    OriginWhenCrossOriginReferrerPolicy
    StrictOriginWhenCrossOriginReferrerPolicy
    UnsafeUrlReferrerPolicy
)

func ReferrerPolicyFromJS Uses

func ReferrerPolicyFromJS(value js.Value) ReferrerPolicy

ReferrerPolicyFromJS is converting a javascript value into a ReferrerPolicy enum value.

func (*ReferrerPolicy) JSValue Uses

func (this *ReferrerPolicy) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (ReferrerPolicy) Value Uses

func (this ReferrerPolicy) Value() string

Value is converting this into javascript defined string value

type Request Uses

type Request struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: Request

func NewRequest Uses

func NewRequest(input *Union, init *RequestInit) (_result *Request)

func RequestFromJS Uses

func RequestFromJS(value js.Wrapper) *Request

RequestFromJS is casting a js.Wrapper into Request.

func (*Request) ArrayBuffer Uses

func (_this *Request) ArrayBuffer() (_result *javascript.PromiseArrayBuffer)

func (*Request) Blob Uses

func (_this *Request) Blob() (_result *file.PromiseBlob)

func (*Request) Body Uses

func (_this *Request) Body() *patch.ReadableStream

Body returning attribute 'body' with type patch.ReadableStream (idl: ReadableStream).

func (*Request) BodyUsed Uses

func (_this *Request) BodyUsed() bool

BodyUsed returning attribute 'bodyUsed' with type bool (idl: boolean).

func (*Request) Cache Uses

func (_this *Request) Cache() RequestCache

Cache returning attribute 'cache' with type RequestCache (idl: RequestCache).

func (*Request) Clone Uses

func (_this *Request) Clone() (_result *Request)

func (*Request) Credentials Uses

func (_this *Request) Credentials() RequestCredentials

Credentials returning attribute 'credentials' with type RequestCredentials (idl: RequestCredentials).

func (*Request) Destination Uses

func (_this *Request) Destination() RequestDestination

Destination returning attribute 'destination' with type RequestDestination (idl: RequestDestination).

func (*Request) FormData Uses

func (_this *Request) FormData() (_result *html.PromiseFormData)

func (*Request) Headers Uses

func (_this *Request) Headers() *Headers

Headers returning attribute 'headers' with type Headers (idl: Headers).

func (*Request) Integrity Uses

func (_this *Request) Integrity() string

Integrity returning attribute 'integrity' with type string (idl: DOMString).

func (*Request) IsHistoryNavigation Uses

func (_this *Request) IsHistoryNavigation() bool

IsHistoryNavigation returning attribute 'isHistoryNavigation' with type bool (idl: boolean).

func (*Request) IsReloadNavigation Uses

func (_this *Request) IsReloadNavigation() bool

IsReloadNavigation returning attribute 'isReloadNavigation' with type bool (idl: boolean).

func (*Request) JSValue Uses

func (_this *Request) JSValue() js.Value

func (*Request) Json Uses

func (_this *Request) Json() (_result *javascript.Promise)

func (*Request) Keepalive Uses

func (_this *Request) Keepalive() bool

Keepalive returning attribute 'keepalive' with type bool (idl: boolean).

func (*Request) Method Uses

func (_this *Request) Method() *patch.ByteString

Method returning attribute 'method' with type patch.ByteString (idl: ByteString).

func (*Request) Mode Uses

func (_this *Request) Mode() RequestMode

Mode returning attribute 'mode' with type RequestMode (idl: RequestMode).

func (*Request) Redirect Uses

func (_this *Request) Redirect() RequestRedirect

Redirect returning attribute 'redirect' with type RequestRedirect (idl: RequestRedirect).

func (*Request) Referrer Uses

func (_this *Request) Referrer() string

Referrer returning attribute 'referrer' with type string (idl: USVString).

func (*Request) ReferrerPolicy Uses

func (_this *Request) ReferrerPolicy() ReferrerPolicy

ReferrerPolicy returning attribute 'referrerPolicy' with type ReferrerPolicy (idl: ReferrerPolicy).

func (*Request) Signal Uses

func (_this *Request) Signal() *domcore.AbortSignal

Signal returning attribute 'signal' with type domcore.AbortSignal (idl: AbortSignal).

func (*Request) Text Uses

func (_this *Request) Text() (_result *javascript.PromiseString)

func (*Request) Url Uses

func (_this *Request) Url() string

Url returning attribute 'url' with type string (idl: USVString).

type RequestCache Uses

type RequestCache int

enum: RequestCache

const (
    DefaultRequestCache RequestCache = iota
    NoStoreRequestCache
    ReloadRequestCache
    NoCacheRequestCache
    ForceCacheRequestCache
    OnlyIfCachedRequestCache
)

func RequestCacheFromJS Uses

func RequestCacheFromJS(value js.Value) RequestCache

RequestCacheFromJS is converting a javascript value into a RequestCache enum value.

func (*RequestCache) JSValue Uses

func (this *RequestCache) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (RequestCache) Value Uses

func (this RequestCache) Value() string

Value is converting this into javascript defined string value

type RequestCredentials Uses

type RequestCredentials int

enum: RequestCredentials

const (
    OmitRequestCredentials RequestCredentials = iota
    SameOriginRequestCredentials
    IncludeRequestCredentials
)

func RequestCredentialsFromJS Uses

func RequestCredentialsFromJS(value js.Value) RequestCredentials

RequestCredentialsFromJS is converting a javascript value into a RequestCredentials enum value.

func (*RequestCredentials) JSValue Uses

func (this *RequestCredentials) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (RequestCredentials) Value Uses

func (this RequestCredentials) Value() string

Value is converting this into javascript defined string value

type RequestDestination Uses

type RequestDestination int

enum: RequestDestination

const (
    EmptyString0RequestDestination RequestDestination = iota
    AudioRequestDestination
    AudioworkletRequestDestination
    DocumentRequestDestination
    EmbedRequestDestination
    FontRequestDestination
    ImageRequestDestination
    ManifestRequestDestination
    ObjectRequestDestination
    PaintworkletRequestDestination
    ReportRequestDestination
    ScriptRequestDestination
    SharedworkerRequestDestination
    StyleRequestDestination
    TrackRequestDestination
    VideoRequestDestination
    WorkerRequestDestination
    XsltRequestDestination
)

func RequestDestinationFromJS Uses

func RequestDestinationFromJS(value js.Value) RequestDestination

RequestDestinationFromJS is converting a javascript value into a RequestDestination enum value.

func (*RequestDestination) JSValue Uses

func (this *RequestDestination) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (RequestDestination) Value Uses

func (this RequestDestination) Value() string

Value is converting this into javascript defined string value

type RequestInit Uses

type RequestInit struct {
    Method         *patch.ByteString
    Headers        [][]*patch.ByteString
    Body           *Union
    Referrer       string
    ReferrerPolicy ReferrerPolicy
    Mode           RequestMode
    Credentials    RequestCredentials
    Cache          RequestCache
    Redirect       RequestRedirect
    Integrity      string
    Keepalive      bool
    Signal         *domcore.AbortSignal
    Window         js.Value
}

dictionary: RequestInit

func RequestInitFromJS Uses

func RequestInitFromJS(value js.Wrapper) *RequestInit

RequestInitFromJS is allocating a new RequestInit object and copy all values from input javascript object

func (*RequestInit) JSValue Uses

func (_this *RequestInit) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type RequestMode Uses

type RequestMode int

enum: RequestMode

const (
    NavigateRequestMode RequestMode = iota
    SameOriginRequestMode
    NoCorsRequestMode
    CorsRequestMode
)

func RequestModeFromJS Uses

func RequestModeFromJS(value js.Value) RequestMode

RequestModeFromJS is converting a javascript value into a RequestMode enum value.

func (*RequestMode) JSValue Uses

func (this *RequestMode) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (RequestMode) Value Uses

func (this RequestMode) Value() string

Value is converting this into javascript defined string value

type RequestRedirect Uses

type RequestRedirect int

enum: RequestRedirect

const (
    FollowRequestRedirect RequestRedirect = iota
    ErrorRequestRedirect
    ManualRequestRedirect
)

func RequestRedirectFromJS Uses

func RequestRedirectFromJS(value js.Value) RequestRedirect

RequestRedirectFromJS is converting a javascript value into a RequestRedirect enum value.

func (*RequestRedirect) JSValue Uses

func (this *RequestRedirect) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (RequestRedirect) Value Uses

func (this RequestRedirect) Value() string

Value is converting this into javascript defined string value

type Response Uses

type Response struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: Response

func Error Uses

func Error() (_result *Response)

func NewResponse Uses

func NewResponse(body *Union, init *ResponseInit) (_result *Response)

func Redirect Uses

func Redirect(url string, status *int) (_result *Response)

func ResponseFromJS Uses

func ResponseFromJS(value js.Wrapper) *Response

ResponseFromJS is casting a js.Wrapper into Response.

func (*Response) ArrayBuffer Uses

func (_this *Response) ArrayBuffer() (_result *javascript.PromiseArrayBuffer)

func (*Response) Blob Uses

func (_this *Response) Blob() (_result *file.PromiseBlob)

func (*Response) Body Uses

func (_this *Response) Body() *patch.ReadableStream

Body returning attribute 'body' with type patch.ReadableStream (idl: ReadableStream).

func (*Response) BodyUsed Uses

func (_this *Response) BodyUsed() bool

BodyUsed returning attribute 'bodyUsed' with type bool (idl: boolean).

func (*Response) Clone Uses

func (_this *Response) Clone() (_result *Response)

func (*Response) FormData Uses

func (_this *Response) FormData() (_result *html.PromiseFormData)

func (*Response) Headers Uses

func (_this *Response) Headers() *Headers

Headers returning attribute 'headers' with type Headers (idl: Headers).

func (*Response) JSValue Uses

func (_this *Response) JSValue() js.Value

func (*Response) Json Uses

func (_this *Response) Json() (_result *javascript.Promise)

func (*Response) Ok Uses

func (_this *Response) Ok() bool

Ok returning attribute 'ok' with type bool (idl: boolean).

func (*Response) Redirected Uses

func (_this *Response) Redirected() bool

Redirected returning attribute 'redirected' with type bool (idl: boolean).

func (*Response) Status Uses

func (_this *Response) Status() int

Status returning attribute 'status' with type int (idl: unsigned short).

func (*Response) StatusText Uses

func (_this *Response) StatusText() *patch.ByteString

StatusText returning attribute 'statusText' with type patch.ByteString (idl: ByteString).

func (*Response) Text Uses

func (_this *Response) Text() (_result *javascript.PromiseString)

func (*Response) Trailer Uses

func (_this *Response) Trailer() *javascript.Promise

Trailer returning attribute 'trailer' with type javascript.Promise (idl: Promise).

func (*Response) Type Uses

func (_this *Response) Type() ResponseType

Type returning attribute 'type' with type ResponseType (idl: ResponseType).

func (*Response) Url Uses

func (_this *Response) Url() string

Url returning attribute 'url' with type string (idl: USVString).

type ResponseInit Uses

type ResponseInit struct {
    Status     int
    StatusText *patch.ByteString
    Headers    [][]*patch.ByteString
}

dictionary: ResponseInit

func ResponseInitFromJS Uses

func ResponseInitFromJS(value js.Wrapper) *ResponseInit

ResponseInitFromJS is allocating a new ResponseInit object and copy all values from input javascript object

func (*ResponseInit) JSValue Uses

func (_this *ResponseInit) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type ResponseType Uses

type ResponseType int

enum: ResponseType

const (
    BasicResponseType ResponseType = iota
    CorsResponseType
    DefaultResponseType
    ErrorResponseType
    OpaqueResponseType
    OpaqueredirectResponseType
)

func ResponseTypeFromJS Uses

func ResponseTypeFromJS(value js.Value) ResponseType

ResponseTypeFromJS is converting a javascript value into a ResponseType enum value.

func (*ResponseType) JSValue Uses

func (this *ResponseType) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (ResponseType) Value Uses

func (this ResponseType) Value() string

Value is converting this into javascript defined string value

type Union Uses

type Union struct {
    Value js.Value
}

func UnionFromJS Uses

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue Uses

func (u *Union) JSValue() js.Value

Directories

PathSynopsis
corsrfc1918Package corsrfc1918 modifications to Fetch which are intended to mitigate the risks associated with unintentional exposure of devices and servers on a client’s internal network to the web at large.

Package fetch imports 6 packages (graph) and is imported by 4 packages. Updated 2019-09-20. Refresh now. Tools for package owners.