cdproto: github.com/chromedp/cdproto/fetch Index | Files

package fetch

import "github.com/chromedp/cdproto/fetch"

Package fetch provides the Chrome DevTools Protocol commands, types, and events for the Fetch domain.

A domain for letting clients substitute browser's network layer with client code.

Generated by the cdproto-gen command.

Index

Package Files

easyjson.go events.go fetch.go types.go

Constants

const (
    CommandDisable                  = "Fetch.disable"
    CommandEnable                   = "Fetch.enable"
    CommandFailRequest              = "Fetch.failRequest"
    CommandFulfillRequest           = "Fetch.fulfillRequest"
    CommandContinueRequest          = "Fetch.continueRequest"
    CommandContinueWithAuth         = "Fetch.continueWithAuth"
    CommandGetResponseBody          = "Fetch.getResponseBody"
    CommandTakeResponseBodyAsStream = "Fetch.takeResponseBodyAsStream"
)

Command names.

type AuthChallenge Uses

type AuthChallenge struct {
    Source AuthChallengeSource `json:"source,omitempty"` // Source of the authentication challenge.
    Origin string              `json:"origin"`           // Origin of the challenger.
    Scheme string              `json:"scheme"`           // The authentication scheme used, such as basic or digest
    Realm  string              `json:"realm"`            // The realm of the challenge. May be empty.
}

AuthChallenge authorization challenge for HTTP status code 401 or 407.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-AuthChallenge

func (AuthChallenge) MarshalEasyJSON Uses

func (v AuthChallenge) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AuthChallenge) MarshalJSON Uses

func (v AuthChallenge) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AuthChallenge) UnmarshalEasyJSON Uses

func (v *AuthChallenge) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AuthChallenge) UnmarshalJSON Uses

func (v *AuthChallenge) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type AuthChallengeResponse Uses

type AuthChallengeResponse struct {
    Response AuthChallengeResponseResponse `json:"response"`           // The decision on what to do in response to the authorization challenge.  Default means deferring to the default behavior of the net stack, which will likely either the Cancel authentication or display a popup dialog box.
    Username string                        `json:"username,omitempty"` // The username to provide, possibly empty. Should only be set if response is ProvideCredentials.
    Password string                        `json:"password,omitempty"` // The password to provide, possibly empty. Should only be set if response is ProvideCredentials.
}

AuthChallengeResponse response to an AuthChallenge.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-AuthChallengeResponse

func (AuthChallengeResponse) MarshalEasyJSON Uses

func (v AuthChallengeResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AuthChallengeResponse) MarshalJSON Uses

func (v AuthChallengeResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AuthChallengeResponse) UnmarshalEasyJSON Uses

func (v *AuthChallengeResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AuthChallengeResponse) UnmarshalJSON Uses

func (v *AuthChallengeResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type AuthChallengeResponseResponse Uses

type AuthChallengeResponseResponse string

AuthChallengeResponseResponse the decision on what to do in response to the authorization challenge. Default means deferring to the default behavior of the net stack, which will likely either the Cancel authentication or display a popup dialog box.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-AuthChallengeResponse

const (
    AuthChallengeResponseResponseDefault            AuthChallengeResponseResponse = "Default"
    AuthChallengeResponseResponseCancelAuth         AuthChallengeResponseResponse = "CancelAuth"
    AuthChallengeResponseResponseProvideCredentials AuthChallengeResponseResponse = "ProvideCredentials"
)

AuthChallengeResponseResponse values.

func (AuthChallengeResponseResponse) MarshalEasyJSON Uses

func (t AuthChallengeResponseResponse) MarshalEasyJSON(out *jwriter.Writer)

MarshalEasyJSON satisfies easyjson.Marshaler.

func (AuthChallengeResponseResponse) MarshalJSON Uses

func (t AuthChallengeResponseResponse) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (AuthChallengeResponseResponse) String Uses

func (t AuthChallengeResponseResponse) String() string

String returns the AuthChallengeResponseResponse as string value.

func (*AuthChallengeResponseResponse) UnmarshalEasyJSON Uses

func (t *AuthChallengeResponseResponse) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON satisfies easyjson.Unmarshaler.

func (*AuthChallengeResponseResponse) UnmarshalJSON Uses

func (t *AuthChallengeResponseResponse) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

type AuthChallengeSource Uses

type AuthChallengeSource string

AuthChallengeSource source of the authentication challenge.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-AuthChallenge

const (
    AuthChallengeSourceServer AuthChallengeSource = "Server"
    AuthChallengeSourceProxy  AuthChallengeSource = "Proxy"
)

AuthChallengeSource values.

func (AuthChallengeSource) MarshalEasyJSON Uses

func (t AuthChallengeSource) MarshalEasyJSON(out *jwriter.Writer)

MarshalEasyJSON satisfies easyjson.Marshaler.

func (AuthChallengeSource) MarshalJSON Uses

func (t AuthChallengeSource) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (AuthChallengeSource) String Uses

func (t AuthChallengeSource) String() string

String returns the AuthChallengeSource as string value.

func (*AuthChallengeSource) UnmarshalEasyJSON Uses

func (t *AuthChallengeSource) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON satisfies easyjson.Unmarshaler.

func (*AuthChallengeSource) UnmarshalJSON Uses

func (t *AuthChallengeSource) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

type ContinueRequestParams Uses

type ContinueRequestParams struct {
    RequestID RequestID      `json:"requestId"`          // An id the client received in requestPaused event.
    URL       string         `json:"url,omitempty"`      // If set, the request url will be modified in a way that's not observable by page.
    Method    string         `json:"method,omitempty"`   // If set, the request method is overridden.
    PostData  string         `json:"postData,omitempty"` // If set, overrides the post data in the request.
    Headers   []*HeaderEntry `json:"headers,omitempty"`  // If set, overrides the request headers.
}

ContinueRequestParams continues the request, optionally modifying some of its parameters.

func ContinueRequest Uses

func ContinueRequest(requestID RequestID) *ContinueRequestParams

ContinueRequest continues the request, optionally modifying some of its parameters.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-continueRequest

parameters:

requestID - An id the client received in requestPaused event.

func (*ContinueRequestParams) Do Uses

func (p *ContinueRequestParams) Do(ctx context.Context) (err error)

Do executes Fetch.continueRequest against the provided context.

func (ContinueRequestParams) MarshalEasyJSON Uses

func (v ContinueRequestParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ContinueRequestParams) MarshalJSON Uses

func (v ContinueRequestParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ContinueRequestParams) UnmarshalEasyJSON Uses

func (v *ContinueRequestParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ContinueRequestParams) UnmarshalJSON Uses

func (v *ContinueRequestParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (ContinueRequestParams) WithHeaders Uses

func (p ContinueRequestParams) WithHeaders(headers []*HeaderEntry) *ContinueRequestParams

WithHeaders if set, overrides the request headers.

func (ContinueRequestParams) WithMethod Uses

func (p ContinueRequestParams) WithMethod(method string) *ContinueRequestParams

WithMethod if set, the request method is overridden.

func (ContinueRequestParams) WithPostData Uses

func (p ContinueRequestParams) WithPostData(postData string) *ContinueRequestParams

WithPostData if set, overrides the post data in the request.

func (ContinueRequestParams) WithURL Uses

func (p ContinueRequestParams) WithURL(url string) *ContinueRequestParams

WithURL if set, the request url will be modified in a way that's not observable by page.

type ContinueWithAuthParams Uses

type ContinueWithAuthParams struct {
    RequestID             RequestID              `json:"requestId"`             // An id the client received in authRequired event.
    AuthChallengeResponse *AuthChallengeResponse `json:"authChallengeResponse"` // Response to  with an authChallenge.
}

ContinueWithAuthParams continues a request supplying authChallengeResponse following authRequired event.

func ContinueWithAuth Uses

func ContinueWithAuth(requestID RequestID, authChallengeResponse *AuthChallengeResponse) *ContinueWithAuthParams

ContinueWithAuth continues a request supplying authChallengeResponse following authRequired event.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-continueWithAuth

parameters:

requestID - An id the client received in authRequired event.
authChallengeResponse - Response to  with an authChallenge.

func (*ContinueWithAuthParams) Do Uses

func (p *ContinueWithAuthParams) Do(ctx context.Context) (err error)

Do executes Fetch.continueWithAuth against the provided context.

func (ContinueWithAuthParams) MarshalEasyJSON Uses

func (v ContinueWithAuthParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ContinueWithAuthParams) MarshalJSON Uses

func (v ContinueWithAuthParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ContinueWithAuthParams) UnmarshalEasyJSON Uses

func (v *ContinueWithAuthParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ContinueWithAuthParams) UnmarshalJSON Uses

func (v *ContinueWithAuthParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DisableParams Uses

type DisableParams struct{}

DisableParams disables the fetch domain.

func Disable Uses

func Disable() *DisableParams

Disable disables the fetch domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-disable

func (*DisableParams) Do Uses

func (p *DisableParams) Do(ctx context.Context) (err error)

Do executes Fetch.disable against the provided context.

func (DisableParams) MarshalEasyJSON Uses

func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DisableParams) MarshalJSON Uses

func (v DisableParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DisableParams) UnmarshalEasyJSON Uses

func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DisableParams) UnmarshalJSON Uses

func (v *DisableParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EnableParams Uses

type EnableParams struct {
    Patterns           []*RequestPattern `json:"patterns,omitempty"`           // If specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected.
    HandleAuthRequests bool              `json:"handleAuthRequests,omitempty"` // If true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth.
}

EnableParams enables issuing of requestPaused events. A request will be paused until client calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth.

func Enable Uses

func Enable() *EnableParams

Enable enables issuing of requestPaused events. A request will be paused until client calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-enable

parameters:

func (*EnableParams) Do Uses

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes Fetch.enable against the provided context.

func (EnableParams) MarshalEasyJSON Uses

func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EnableParams) MarshalJSON Uses

func (v EnableParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EnableParams) UnmarshalEasyJSON Uses

func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EnableParams) UnmarshalJSON Uses

func (v *EnableParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (EnableParams) WithHandleAuthRequests Uses

func (p EnableParams) WithHandleAuthRequests(handleAuthRequests bool) *EnableParams

WithHandleAuthRequests if true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth.

func (EnableParams) WithPatterns Uses

func (p EnableParams) WithPatterns(patterns []*RequestPattern) *EnableParams

WithPatterns if specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected.

type EventAuthRequired Uses

type EventAuthRequired struct {
    RequestID     RequestID            `json:"requestId"`     // Each request the page makes will have a unique id.
    Request       *network.Request     `json:"request"`       // The details of the request.
    FrameID       cdp.FrameID          `json:"frameId"`       // The id of the frame that initiated the request.
    ResourceType  network.ResourceType `json:"resourceType"`  // How the requested resource will be used.
    AuthChallenge *AuthChallenge       `json:"authChallenge"` // Details of the Authorization Challenge encountered. If this is set, client should respond with continueRequest that contains AuthChallengeResponse.
}

EventAuthRequired issued when the domain is enabled with handleAuthRequests set to true. The request is paused until client responds with continueWithAuth.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#event-authRequired

func (EventAuthRequired) MarshalEasyJSON Uses

func (v EventAuthRequired) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventAuthRequired) MarshalJSON Uses

func (v EventAuthRequired) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventAuthRequired) UnmarshalEasyJSON Uses

func (v *EventAuthRequired) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventAuthRequired) UnmarshalJSON Uses

func (v *EventAuthRequired) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventRequestPaused Uses

type EventRequestPaused struct {
    RequestID           RequestID            `json:"requestId"`                     // Each request the page makes will have a unique id.
    Request             *network.Request     `json:"request"`                       // The details of the request.
    FrameID             cdp.FrameID          `json:"frameId"`                       // The id of the frame that initiated the request.
    ResourceType        network.ResourceType `json:"resourceType"`                  // How the requested resource will be used.
    ResponseErrorReason network.ErrorReason  `json:"responseErrorReason,omitempty"` // Response error if intercepted at response stage.
    ResponseStatusCode  int64                `json:"responseStatusCode,omitempty"`  // Response code if intercepted at response stage.
    ResponseHeaders     []*HeaderEntry       `json:"responseHeaders,omitempty"`     // Response headers if intercepted at the response stage.
    NetworkID           RequestID            `json:"networkId,omitempty"`           // If the intercepted request had a corresponding Network.requestWillBeSent event fired for it, then this networkId will be the same as the requestId present in the requestWillBeSent event.
}

EventRequestPaused issued when the domain is enabled and the request URL matches the specified filter. The request is paused until the client responds with one of continueRequest, failRequest or fulfillRequest. The stage of the request can be determined by presence of responseErrorReason and responseStatusCode -- the request is at the response stage if either of these fields is present and in the request stage otherwise.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#event-requestPaused

func (EventRequestPaused) MarshalEasyJSON Uses

func (v EventRequestPaused) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventRequestPaused) MarshalJSON Uses

func (v EventRequestPaused) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventRequestPaused) UnmarshalEasyJSON Uses

func (v *EventRequestPaused) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventRequestPaused) UnmarshalJSON Uses

func (v *EventRequestPaused) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type FailRequestParams Uses

type FailRequestParams struct {
    RequestID   RequestID           `json:"requestId"`   // An id the client received in requestPaused event.
    ErrorReason network.ErrorReason `json:"errorReason"` // Causes the request to fail with the given reason.
}

FailRequestParams causes the request to fail with specified reason.

func FailRequest Uses

func FailRequest(requestID RequestID, errorReason network.ErrorReason) *FailRequestParams

FailRequest causes the request to fail with specified reason.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-failRequest

parameters:

requestID - An id the client received in requestPaused event.
errorReason - Causes the request to fail with the given reason.

func (*FailRequestParams) Do Uses

func (p *FailRequestParams) Do(ctx context.Context) (err error)

Do executes Fetch.failRequest against the provided context.

func (FailRequestParams) MarshalEasyJSON Uses

func (v FailRequestParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (FailRequestParams) MarshalJSON Uses

func (v FailRequestParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*FailRequestParams) UnmarshalEasyJSON Uses

func (v *FailRequestParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*FailRequestParams) UnmarshalJSON Uses

func (v *FailRequestParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type FulfillRequestParams Uses

type FulfillRequestParams struct {
    RequestID             RequestID      `json:"requestId"`                       // An id the client received in requestPaused event.
    ResponseCode          int64          `json:"responseCode"`                    // An HTTP response code.
    ResponseHeaders       []*HeaderEntry `json:"responseHeaders,omitempty"`       // Response headers.
    BinaryResponseHeaders string         `json:"binaryResponseHeaders,omitempty"` // Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text.
    Body                  string         `json:"body,omitempty"`                  // A response body.
    ResponsePhrase        string         `json:"responsePhrase,omitempty"`        // A textual representation of responseCode. If absent, a standard phrase matching responseCode is used.
}

FulfillRequestParams provides response to the request.

func FulfillRequest Uses

func FulfillRequest(requestID RequestID, responseCode int64) *FulfillRequestParams

FulfillRequest provides response to the request.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-fulfillRequest

parameters:

requestID - An id the client received in requestPaused event.
responseCode - An HTTP response code.

func (*FulfillRequestParams) Do Uses

func (p *FulfillRequestParams) Do(ctx context.Context) (err error)

Do executes Fetch.fulfillRequest against the provided context.

func (FulfillRequestParams) MarshalEasyJSON Uses

func (v FulfillRequestParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (FulfillRequestParams) MarshalJSON Uses

func (v FulfillRequestParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*FulfillRequestParams) UnmarshalEasyJSON Uses

func (v *FulfillRequestParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*FulfillRequestParams) UnmarshalJSON Uses

func (v *FulfillRequestParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (FulfillRequestParams) WithBinaryResponseHeaders Uses

func (p FulfillRequestParams) WithBinaryResponseHeaders(binaryResponseHeaders string) *FulfillRequestParams

WithBinaryResponseHeaders alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text.

func (FulfillRequestParams) WithBody Uses

func (p FulfillRequestParams) WithBody(body string) *FulfillRequestParams

WithBody a response body.

func (FulfillRequestParams) WithResponseHeaders Uses

func (p FulfillRequestParams) WithResponseHeaders(responseHeaders []*HeaderEntry) *FulfillRequestParams

WithResponseHeaders response headers.

func (FulfillRequestParams) WithResponsePhrase Uses

func (p FulfillRequestParams) WithResponsePhrase(responsePhrase string) *FulfillRequestParams

WithResponsePhrase a textual representation of responseCode. If absent, a standard phrase matching responseCode is used.

type GetResponseBodyParams Uses

type GetResponseBodyParams struct {
    RequestID RequestID `json:"requestId"` // Identifier for the intercepted request to get body for.
}

GetResponseBodyParams causes the body of the response to be received from the server and returned as a single string. May only be issued for a request that is paused in the Response stage and is mutually exclusive with takeResponseBodyForInterceptionAsStream. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.

func GetResponseBody Uses

func GetResponseBody(requestID RequestID) *GetResponseBodyParams

GetResponseBody causes the body of the response to be received from the server and returned as a single string. May only be issued for a request that is paused in the Response stage and is mutually exclusive with takeResponseBodyForInterceptionAsStream. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-getResponseBody

parameters:

requestID - Identifier for the intercepted request to get body for.

func (*GetResponseBodyParams) Do Uses

func (p *GetResponseBodyParams) Do(ctx context.Context) (body []byte, err error)

Do executes Fetch.getResponseBody against the provided context.

returns:

body - Response body.

func (GetResponseBodyParams) MarshalEasyJSON Uses

func (v GetResponseBodyParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetResponseBodyParams) MarshalJSON Uses

func (v GetResponseBodyParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetResponseBodyParams) UnmarshalEasyJSON Uses

func (v *GetResponseBodyParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetResponseBodyParams) UnmarshalJSON Uses

func (v *GetResponseBodyParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetResponseBodyReturns Uses

type GetResponseBodyReturns struct {
    Body          string `json:"body,omitempty"`          // Response body.
    Base64encoded bool   `json:"base64Encoded,omitempty"` // True, if content was sent as base64.
}

GetResponseBodyReturns return values.

func (GetResponseBodyReturns) MarshalEasyJSON Uses

func (v GetResponseBodyReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetResponseBodyReturns) MarshalJSON Uses

func (v GetResponseBodyReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetResponseBodyReturns) UnmarshalEasyJSON Uses

func (v *GetResponseBodyReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetResponseBodyReturns) UnmarshalJSON Uses

func (v *GetResponseBodyReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type HeaderEntry Uses

type HeaderEntry struct {
    Name  string `json:"name"`
    Value string `json:"value"`
}

HeaderEntry response HTTP header entry.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-HeaderEntry

func (HeaderEntry) MarshalEasyJSON Uses

func (v HeaderEntry) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (HeaderEntry) MarshalJSON Uses

func (v HeaderEntry) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*HeaderEntry) UnmarshalEasyJSON Uses

func (v *HeaderEntry) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*HeaderEntry) UnmarshalJSON Uses

func (v *HeaderEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RequestID Uses

type RequestID string

RequestID unique request identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-RequestId

func (RequestID) String Uses

func (t RequestID) String() string

String returns the RequestID as string value.

type RequestPattern Uses

type RequestPattern struct {
    URLPattern   string               `json:"urlPattern,omitempty"`   // Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*".
    ResourceType network.ResourceType `json:"resourceType,omitempty"` // If set, only requests for matching resource types will be intercepted.
    RequestStage RequestStage         `json:"requestStage,omitempty"` // Stage at which to begin intercepting requests. Default is Request.
}

RequestPattern [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-RequestPattern

func (RequestPattern) MarshalEasyJSON Uses

func (v RequestPattern) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (RequestPattern) MarshalJSON Uses

func (v RequestPattern) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*RequestPattern) UnmarshalEasyJSON Uses

func (v *RequestPattern) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*RequestPattern) UnmarshalJSON Uses

func (v *RequestPattern) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RequestStage Uses

type RequestStage string

RequestStage stages of the request to handle. Request will intercept before the request is sent. Response will intercept after the response is received (but before response body is received.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-RequestStage

const (
    RequestStageRequest  RequestStage = "Request"
    RequestStageResponse RequestStage = "Response"
)

RequestStage values.

func (RequestStage) MarshalEasyJSON Uses

func (t RequestStage) MarshalEasyJSON(out *jwriter.Writer)

MarshalEasyJSON satisfies easyjson.Marshaler.

func (RequestStage) MarshalJSON Uses

func (t RequestStage) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (RequestStage) String Uses

func (t RequestStage) String() string

String returns the RequestStage as string value.

func (*RequestStage) UnmarshalEasyJSON Uses

func (t *RequestStage) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON satisfies easyjson.Unmarshaler.

func (*RequestStage) UnmarshalJSON Uses

func (t *RequestStage) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

type TakeResponseBodyAsStreamParams Uses

type TakeResponseBodyAsStreamParams struct {
    RequestID RequestID `json:"requestId"`
}

TakeResponseBodyAsStreamParams returns a handle to the stream representing the response body. The request must be paused in the HeadersReceived stage. Note that after this command the request can't be continued as is -- client either needs to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. This method is mutually exclusive with getResponseBody. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.

func TakeResponseBodyAsStream Uses

func TakeResponseBodyAsStream(requestID RequestID) *TakeResponseBodyAsStreamParams

TakeResponseBodyAsStream returns a handle to the stream representing the response body. The request must be paused in the HeadersReceived stage. Note that after this command the request can't be continued as is -- client either needs to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. This method is mutually exclusive with getResponseBody. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-takeResponseBodyAsStream

parameters:

requestID

func (*TakeResponseBodyAsStreamParams) Do Uses

func (p *TakeResponseBodyAsStreamParams) Do(ctx context.Context) (stream io.StreamHandle, err error)

Do executes Fetch.takeResponseBodyAsStream against the provided context.

returns:

stream

func (TakeResponseBodyAsStreamParams) MarshalEasyJSON Uses

func (v TakeResponseBodyAsStreamParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TakeResponseBodyAsStreamParams) MarshalJSON Uses

func (v TakeResponseBodyAsStreamParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TakeResponseBodyAsStreamParams) UnmarshalEasyJSON Uses

func (v *TakeResponseBodyAsStreamParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TakeResponseBodyAsStreamParams) UnmarshalJSON Uses

func (v *TakeResponseBodyAsStreamParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TakeResponseBodyAsStreamReturns Uses

type TakeResponseBodyAsStreamReturns struct {
    Stream io.StreamHandle `json:"stream,omitempty"`
}

TakeResponseBodyAsStreamReturns return values.

func (TakeResponseBodyAsStreamReturns) MarshalEasyJSON Uses

func (v TakeResponseBodyAsStreamReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TakeResponseBodyAsStreamReturns) MarshalJSON Uses

func (v TakeResponseBodyAsStreamReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TakeResponseBodyAsStreamReturns) UnmarshalEasyJSON Uses

func (v *TakeResponseBodyAsStreamReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TakeResponseBodyAsStreamReturns) UnmarshalJSON Uses

func (v *TakeResponseBodyAsStreamReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Package fetch imports 10 packages (graph) and is imported by 5 packages. Updated 2021-01-11. Refresh now. Tools for package owners.