Documentation ¶
Overview ¶
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 ¶
- type Headers
- func (_this *Headers) Append(name *patch.ByteString, value *patch.ByteString)
- func (_this *Headers) Delete(name *patch.ByteString)
- func (_this *Headers) Entries() (_result *HeadersEntryIterator)
- func (_this *Headers) ForEach(callback *HeadersForEach, optionalThisForCallbackArgument interface{})
- func (_this *Headers) Get(name *patch.ByteString) (_result *patch.ByteString)
- func (_this *Headers) Has(name *patch.ByteString) (_result bool)
- func (_this *Headers) JSValue() js.Value
- func (_this *Headers) Keys() (_result *HeadersKeyIterator)
- func (_this *Headers) Set(name *patch.ByteString, value *patch.ByteString)
- func (_this *Headers) Values() (_result *HeadersValueIterator)
- type HeadersEntryIterator
- type HeadersEntryIteratorValue
- type HeadersForEach
- type HeadersForEachFunc
- type HeadersKeyIterator
- type HeadersKeyIteratorValue
- type HeadersValueIterator
- type HeadersValueIteratorValue
- type PromiseResponse
- func (_this *PromiseResponse) Catch(onRejected *PromiseResponseOnRejected) (_result *PromiseResponse)
- func (_this *PromiseResponse) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseResponse)
- func (_this *PromiseResponse) JSValue() js.Value
- func (_this *PromiseResponse) Then(onFulfilled *PromiseResponseOnFulfilled, onRejected *PromiseResponseOnRejected) (_result *PromiseResponse)
- type PromiseResponseOnFulfilled
- type PromiseResponseOnFulfilledFunc
- type PromiseResponseOnRejected
- type PromiseResponseOnRejectedFunc
- type ReferrerPolicy
- type Request
- func (_this *Request) ArrayBuffer() (_result *javascript.PromiseArrayBuffer)
- func (_this *Request) Blob() (_result *file.PromiseBlob)
- func (_this *Request) Body() *patch.ReadableStream
- func (_this *Request) BodyUsed() bool
- func (_this *Request) Cache() RequestCache
- func (_this *Request) Clone() (_result *Request)
- func (_this *Request) Credentials() RequestCredentials
- func (_this *Request) Destination() RequestDestination
- func (_this *Request) FormData() (_result *html.PromiseFormData)
- func (_this *Request) Headers() *Headers
- func (_this *Request) Integrity() string
- func (_this *Request) IsHistoryNavigation() bool
- func (_this *Request) IsReloadNavigation() bool
- func (_this *Request) JSValue() js.Value
- func (_this *Request) Json() (_result *javascript.Promise)
- func (_this *Request) Keepalive() bool
- func (_this *Request) Method() *patch.ByteString
- func (_this *Request) Mode() RequestMode
- func (_this *Request) Redirect() RequestRedirect
- func (_this *Request) Referrer() string
- func (_this *Request) ReferrerPolicy() ReferrerPolicy
- func (_this *Request) Signal() *domcore.AbortSignal
- func (_this *Request) Text() (_result *javascript.PromiseString)
- func (_this *Request) Url() string
- type RequestCache
- type RequestCredentials
- type RequestDestination
- type RequestInit
- type RequestMode
- type RequestRedirect
- type Response
- func (_this *Response) ArrayBuffer() (_result *javascript.PromiseArrayBuffer)
- func (_this *Response) Blob() (_result *file.PromiseBlob)
- func (_this *Response) Body() *patch.ReadableStream
- func (_this *Response) BodyUsed() bool
- func (_this *Response) Clone() (_result *Response)
- func (_this *Response) FormData() (_result *html.PromiseFormData)
- func (_this *Response) Headers() *Headers
- func (_this *Response) JSValue() js.Value
- func (_this *Response) Json() (_result *javascript.Promise)
- func (_this *Response) Ok() bool
- func (_this *Response) Redirected() bool
- func (_this *Response) Status() int
- func (_this *Response) StatusText() *patch.ByteString
- func (_this *Response) Text() (_result *javascript.PromiseString)
- func (_this *Response) Trailer() *javascript.Promise
- func (_this *Response) Type() ResponseType
- func (_this *Response) Url() string
- type ResponseInit
- type ResponseType
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Headers ¶
class: Headers
func HeadersFromJS ¶
HeadersFromJS is casting a js.Wrapper into Headers.
func NewHeaders ¶
func NewHeaders(init [][]*patch.ByteString) (_result *Headers)
func (*Headers) Append ¶
func (_this *Headers) Append(name *patch.ByteString, value *patch.ByteString)
func (*Headers) Delete ¶
func (_this *Headers) Delete(name *patch.ByteString)
func (*Headers) Entries ¶
func (_this *Headers) Entries() (_result *HeadersEntryIterator)
func (*Headers) ForEach ¶
func (_this *Headers) ForEach(callback *HeadersForEach, optionalThisForCallbackArgument interface{})
func (*Headers) Get ¶
func (_this *Headers) Get(name *patch.ByteString) (_result *patch.ByteString)
func (*Headers) Keys ¶
func (_this *Headers) Keys() (_result *HeadersKeyIterator)
func (*Headers) Set ¶
func (_this *Headers) Set(name *patch.ByteString, value *patch.ByteString)
func (*Headers) Values ¶
func (_this *Headers) Values() (_result *HeadersValueIterator)
type HeadersEntryIterator ¶
type HeadersEntryIterator struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: HeadersEntryIterator
func HeadersEntryIteratorFromJS ¶
func HeadersEntryIteratorFromJS(value js.Wrapper) *HeadersEntryIterator
HeadersEntryIteratorFromJS is casting a js.Wrapper into HeadersEntryIterator.
func (*HeadersEntryIterator) JSValue ¶
func (_this *HeadersEntryIterator) JSValue() js.Value
func (*HeadersEntryIterator) Next ¶
func (_this *HeadersEntryIterator) Next() (_result *HeadersEntryIteratorValue)
type HeadersEntryIteratorValue ¶
dictionary: HeadersEntryIteratorValue
func HeadersEntryIteratorValueFromJS ¶
func HeadersEntryIteratorValueFromJS(value js.Wrapper) *HeadersEntryIteratorValue
HeadersEntryIteratorValueFromJS is allocating a new HeadersEntryIteratorValue object and copy all values from input javascript object
func (*HeadersEntryIteratorValue) JSValue ¶
func (_this *HeadersEntryIteratorValue) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type HeadersForEach ¶
HeadersForEach is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func HeadersForEachToJS ¶
func HeadersForEachToJS(callback HeadersForEachFunc) *HeadersForEach
type HeadersForEachFunc ¶
type HeadersForEachFunc func(currentValue *patch.ByteString, currentIndex int, listObj *Headers)
callback: HeadersForEach
func HeadersForEachFromJS ¶
func HeadersForEachFromJS(_value js.Value) HeadersForEachFunc
type HeadersKeyIterator ¶
type HeadersKeyIterator struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: HeadersKeyIterator
func HeadersKeyIteratorFromJS ¶
func HeadersKeyIteratorFromJS(value js.Wrapper) *HeadersKeyIterator
HeadersKeyIteratorFromJS is casting a js.Wrapper into HeadersKeyIterator.
func (*HeadersKeyIterator) JSValue ¶
func (_this *HeadersKeyIterator) JSValue() js.Value
func (*HeadersKeyIterator) Next ¶
func (_this *HeadersKeyIterator) Next() (_result *HeadersKeyIteratorValue)
type HeadersKeyIteratorValue ¶
type HeadersKeyIteratorValue struct { Value *patch.ByteString Done bool }
dictionary: HeadersKeyIteratorValue
func HeadersKeyIteratorValueFromJS ¶
func HeadersKeyIteratorValueFromJS(value js.Wrapper) *HeadersKeyIteratorValue
HeadersKeyIteratorValueFromJS is allocating a new HeadersKeyIteratorValue object and copy all values from input javascript object
func (*HeadersKeyIteratorValue) JSValue ¶
func (_this *HeadersKeyIteratorValue) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type HeadersValueIterator ¶
type HeadersValueIterator struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: HeadersValueIterator
func HeadersValueIteratorFromJS ¶
func HeadersValueIteratorFromJS(value js.Wrapper) *HeadersValueIterator
HeadersValueIteratorFromJS is casting a js.Wrapper into HeadersValueIterator.
func (*HeadersValueIterator) JSValue ¶
func (_this *HeadersValueIterator) JSValue() js.Value
func (*HeadersValueIterator) Next ¶
func (_this *HeadersValueIterator) Next() (_result *HeadersValueIteratorValue)
type HeadersValueIteratorValue ¶
type HeadersValueIteratorValue struct { Value *patch.ByteString Done bool }
dictionary: HeadersValueIteratorValue
func HeadersValueIteratorValueFromJS ¶
func HeadersValueIteratorValueFromJS(value js.Wrapper) *HeadersValueIteratorValue
HeadersValueIteratorValueFromJS is allocating a new HeadersValueIteratorValue object and copy all values from input javascript object
func (*HeadersValueIteratorValue) JSValue ¶
func (_this *HeadersValueIteratorValue) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type PromiseResponse ¶
type PromiseResponse struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: Promise
func PromiseResponseFromJS ¶
func PromiseResponseFromJS(value js.Wrapper) *PromiseResponse
PromiseResponseFromJS is casting a js.Wrapper into PromiseResponse.
func (*PromiseResponse) Catch ¶
func (_this *PromiseResponse) Catch(onRejected *PromiseResponseOnRejected) (_result *PromiseResponse)
func (*PromiseResponse) Finally ¶
func (_this *PromiseResponse) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseResponse)
func (*PromiseResponse) JSValue ¶
func (_this *PromiseResponse) JSValue() js.Value
func (*PromiseResponse) Then ¶
func (_this *PromiseResponse) Then(onFulfilled *PromiseResponseOnFulfilled, onRejected *PromiseResponseOnRejected) (_result *PromiseResponse)
type PromiseResponseOnFulfilled ¶
PromiseResponseOnFulfilled is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromiseResponseOnFulfilledToJS ¶
func PromiseResponseOnFulfilledToJS(callback PromiseResponseOnFulfilledFunc) *PromiseResponseOnFulfilled
type PromiseResponseOnFulfilledFunc ¶
type PromiseResponseOnFulfilledFunc func(value *Response)
callback: PromiseTemplateOnFulfilled
func PromiseResponseOnFulfilledFromJS ¶
func PromiseResponseOnFulfilledFromJS(_value js.Value) PromiseResponseOnFulfilledFunc
type PromiseResponseOnRejected ¶
PromiseResponseOnRejected is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromiseResponseOnRejectedToJS ¶
func PromiseResponseOnRejectedToJS(callback PromiseResponseOnRejectedFunc) *PromiseResponseOnRejected
type PromiseResponseOnRejectedFunc ¶
callback: PromiseTemplateOnRejected
func PromiseResponseOnRejectedFromJS ¶
func PromiseResponseOnRejectedFromJS(_value js.Value) PromiseResponseOnRejectedFunc
type ReferrerPolicy ¶
type ReferrerPolicy int
enum: ReferrerPolicy
const ( EmptyString0ReferrerPolicy ReferrerPolicy = iota NoReferrerReferrerPolicy NoReferrerWhenDowngradeReferrerPolicy SameOriginReferrerPolicy OriginReferrerPolicy StrictOriginReferrerPolicy OriginWhenCrossOriginReferrerPolicy StrictOriginWhenCrossOriginReferrerPolicy UnsafeUrlReferrerPolicy )
func ReferrerPolicyFromJS ¶
func ReferrerPolicyFromJS(value js.Value) ReferrerPolicy
ReferrerPolicyFromJS is converting a javascript value into a ReferrerPolicy enum value.
func (*ReferrerPolicy) JSValue ¶
func (this *ReferrerPolicy) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (ReferrerPolicy) Value ¶
func (this ReferrerPolicy) Value() string
Value is converting this into javascript defined string value
type Request ¶
class: Request
func NewRequest ¶
func NewRequest(input *Union, init *RequestInit) (_result *Request)
func RequestFromJS ¶
RequestFromJS is casting a js.Wrapper into Request.
func (*Request) ArrayBuffer ¶
func (_this *Request) ArrayBuffer() (_result *javascript.PromiseArrayBuffer)
func (*Request) Blob ¶
func (_this *Request) Blob() (_result *file.PromiseBlob)
func (*Request) Body ¶
func (_this *Request) Body() *patch.ReadableStream
Body returning attribute 'body' with type patch.ReadableStream (idl: ReadableStream).
func (*Request) Cache ¶
func (_this *Request) Cache() RequestCache
Cache returning attribute 'cache' with type RequestCache (idl: RequestCache).
func (*Request) Credentials ¶
func (_this *Request) Credentials() RequestCredentials
Credentials returning attribute 'credentials' with type RequestCredentials (idl: RequestCredentials).
func (*Request) Destination ¶
func (_this *Request) Destination() RequestDestination
Destination returning attribute 'destination' with type RequestDestination (idl: RequestDestination).
func (*Request) FormData ¶
func (_this *Request) FormData() (_result *html.PromiseFormData)
func (*Request) Integrity ¶
Integrity returning attribute 'integrity' with type string (idl: DOMString).
func (*Request) IsHistoryNavigation ¶
IsHistoryNavigation returning attribute 'isHistoryNavigation' with type bool (idl: boolean).
func (*Request) IsReloadNavigation ¶
IsReloadNavigation returning attribute 'isReloadNavigation' with type bool (idl: boolean).
func (*Request) Json ¶
func (_this *Request) Json() (_result *javascript.Promise)
func (*Request) Keepalive ¶
Keepalive returning attribute 'keepalive' with type bool (idl: boolean).
func (*Request) Method ¶
func (_this *Request) Method() *patch.ByteString
Method returning attribute 'method' with type patch.ByteString (idl: ByteString).
func (*Request) Mode ¶
func (_this *Request) Mode() RequestMode
Mode returning attribute 'mode' with type RequestMode (idl: RequestMode).
func (*Request) Redirect ¶
func (_this *Request) Redirect() RequestRedirect
Redirect returning attribute 'redirect' with type RequestRedirect (idl: RequestRedirect).
func (*Request) Referrer ¶
Referrer returning attribute 'referrer' with type string (idl: USVString).
func (*Request) ReferrerPolicy ¶
func (_this *Request) ReferrerPolicy() ReferrerPolicy
ReferrerPolicy returning attribute 'referrerPolicy' with type ReferrerPolicy (idl: ReferrerPolicy).
func (*Request) Signal ¶
func (_this *Request) Signal() *domcore.AbortSignal
Signal returning attribute 'signal' with type domcore.AbortSignal (idl: AbortSignal).
func (*Request) Text ¶
func (_this *Request) Text() (_result *javascript.PromiseString)
type RequestCache ¶
type RequestCache int
enum: RequestCache
const ( DefaultRequestCache RequestCache = iota NoStoreRequestCache ReloadRequestCache NoCacheRequestCache ForceCacheRequestCache OnlyIfCachedRequestCache )
func RequestCacheFromJS ¶
func RequestCacheFromJS(value js.Value) RequestCache
RequestCacheFromJS is converting a javascript value into a RequestCache enum value.
func (*RequestCache) JSValue ¶
func (this *RequestCache) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (RequestCache) Value ¶
func (this RequestCache) Value() string
Value is converting this into javascript defined string value
type RequestCredentials ¶
type RequestCredentials int
enum: RequestCredentials
const ( OmitRequestCredentials RequestCredentials = iota SameOriginRequestCredentials IncludeRequestCredentials )
func RequestCredentialsFromJS ¶
func RequestCredentialsFromJS(value js.Value) RequestCredentials
RequestCredentialsFromJS is converting a javascript value into a RequestCredentials enum value.
func (*RequestCredentials) JSValue ¶
func (this *RequestCredentials) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (RequestCredentials) Value ¶
func (this RequestCredentials) Value() string
Value is converting this into javascript defined string value
type RequestDestination ¶
type RequestDestination int
enum: RequestDestination
const ( EmptyString0RequestDestination RequestDestination = iota AudioRequestDestination AudioworkletRequestDestination DocumentRequestDestination EmbedRequestDestination FontRequestDestination ImageRequestDestination ManifestRequestDestination ObjectRequestDestination PaintworkletRequestDestination ReportRequestDestination ScriptRequestDestination StyleRequestDestination TrackRequestDestination VideoRequestDestination WorkerRequestDestination XsltRequestDestination )
func RequestDestinationFromJS ¶
func RequestDestinationFromJS(value js.Value) RequestDestination
RequestDestinationFromJS is converting a javascript value into a RequestDestination enum value.
func (*RequestDestination) JSValue ¶
func (this *RequestDestination) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (RequestDestination) Value ¶
func (this RequestDestination) Value() string
Value is converting this into javascript defined string value
type RequestInit ¶
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 ¶
func RequestInitFromJS(value js.Wrapper) *RequestInit
RequestInitFromJS is allocating a new RequestInit object and copy all values from input javascript object
func (*RequestInit) JSValue ¶
func (_this *RequestInit) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type RequestMode ¶
type RequestMode int
enum: RequestMode
const ( SameOriginRequestMode NoCorsRequestMode CorsRequestMode )
func RequestModeFromJS ¶
func RequestModeFromJS(value js.Value) RequestMode
RequestModeFromJS is converting a javascript value into a RequestMode enum value.
func (*RequestMode) JSValue ¶
func (this *RequestMode) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (RequestMode) Value ¶
func (this RequestMode) Value() string
Value is converting this into javascript defined string value
type RequestRedirect ¶
type RequestRedirect int
enum: RequestRedirect
const ( FollowRequestRedirect RequestRedirect = iota ErrorRequestRedirect ManualRequestRedirect )
func RequestRedirectFromJS ¶
func RequestRedirectFromJS(value js.Value) RequestRedirect
RequestRedirectFromJS is converting a javascript value into a RequestRedirect enum value.
func (*RequestRedirect) JSValue ¶
func (this *RequestRedirect) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (RequestRedirect) Value ¶
func (this RequestRedirect) Value() string
Value is converting this into javascript defined string value
type Response ¶
class: Response
func NewResponse ¶
func NewResponse(body *Union, init *ResponseInit) (_result *Response)
func ResponseFromJS ¶
ResponseFromJS is casting a js.Wrapper into Response.
func (*Response) ArrayBuffer ¶
func (_this *Response) ArrayBuffer() (_result *javascript.PromiseArrayBuffer)
func (*Response) Blob ¶
func (_this *Response) Blob() (_result *file.PromiseBlob)
func (*Response) Body ¶
func (_this *Response) Body() *patch.ReadableStream
Body returning attribute 'body' with type patch.ReadableStream (idl: ReadableStream).
func (*Response) FormData ¶
func (_this *Response) FormData() (_result *html.PromiseFormData)
func (*Response) Json ¶
func (_this *Response) Json() (_result *javascript.Promise)
func (*Response) Redirected ¶
Redirected returning attribute 'redirected' with type bool (idl: boolean).
func (*Response) StatusText ¶
func (_this *Response) StatusText() *patch.ByteString
StatusText returning attribute 'statusText' with type patch.ByteString (idl: ByteString).
func (*Response) Text ¶
func (_this *Response) Text() (_result *javascript.PromiseString)
func (*Response) Trailer ¶
func (_this *Response) Trailer() *javascript.Promise
Trailer returning attribute 'trailer' with type javascript.Promise (idl: Promise).
func (*Response) Type ¶
func (_this *Response) Type() ResponseType
Type returning attribute 'type' with type ResponseType (idl: ResponseType).
type ResponseInit ¶
type ResponseInit struct { Status int StatusText *patch.ByteString Headers [][]*patch.ByteString }
dictionary: ResponseInit
func ResponseInitFromJS ¶
func ResponseInitFromJS(value js.Wrapper) *ResponseInit
ResponseInitFromJS is allocating a new ResponseInit object and copy all values from input javascript object
func (*ResponseInit) JSValue ¶
func (_this *ResponseInit) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type ResponseType ¶
type ResponseType int
enum: ResponseType
const ( BasicResponseType ResponseType = iota CorsResponseType DefaultResponseType ErrorResponseType OpaqueResponseType OpaqueredirectResponseType )
func ResponseTypeFromJS ¶
func ResponseTypeFromJS(value js.Value) ResponseType
ResponseTypeFromJS is converting a javascript value into a ResponseType enum value.
func (*ResponseType) JSValue ¶
func (this *ResponseType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (ResponseType) Value ¶
func (this ResponseType) Value() string
Value is converting this into javascript defined string value
Directories ¶
Path | Synopsis |
---|---|
Package 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 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. |