2017-01-24 15:09:23 +00:00
package network
// AUTOGENERATED. DO NOT EDIT.
import (
2017-01-26 07:28:34 +00:00
cdp "github.com/knq/chromedp/cdp"
2017-01-24 15:09:23 +00:00
"github.com/knq/chromedp/cdp/page"
)
// EventResourceChangedPriority fired when resource loading priority is
// changed.
type EventResourceChangedPriority struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
NewPriority ResourcePriority ` json:"newPriority,omitempty" ` // New priority
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
}
// EventRequestWillBeSent fired when page is about to send HTTP request.
type EventRequestWillBeSent struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
FrameID cdp . FrameID ` json:"frameId,omitempty" ` // Frame identifier.
LoaderID cdp . LoaderID ` json:"loaderId,omitempty" ` // Loader identifier.
2017-01-24 15:09:23 +00:00
DocumentURL string ` json:"documentURL,omitempty" ` // URL of the document this request is loaded for.
Request * Request ` json:"request,omitempty" ` // Request data.
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
WallTime cdp . Timestamp ` json:"wallTime,omitempty" ` // UTC Timestamp.
2017-01-24 15:09:23 +00:00
Initiator * Initiator ` json:"initiator,omitempty" ` // Request initiator.
RedirectResponse * Response ` json:"redirectResponse,omitempty" ` // Redirect response data.
Type page . ResourceType ` json:"type,omitempty" ` // Type of this resource.
}
// EventRequestServedFromCache fired if request ended up loading from cache.
type EventRequestServedFromCache struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
}
// EventResponseReceived fired when HTTP response is available.
type EventResponseReceived struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
FrameID cdp . FrameID ` json:"frameId,omitempty" ` // Frame identifier.
LoaderID cdp . LoaderID ` json:"loaderId,omitempty" ` // Loader identifier.
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
Type page . ResourceType ` json:"type,omitempty" ` // Resource type.
Response * Response ` json:"response,omitempty" ` // Response data.
}
// EventDataReceived fired when data chunk was received over the network.
type EventDataReceived struct {
2017-01-26 07:28:34 +00:00
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
DataLength int64 ` json:"dataLength,omitempty" ` // Data chunk length.
EncodedDataLength int64 ` json:"encodedDataLength,omitempty" ` // Actual bytes received (might be less than dataLength for compressed encodings).
2017-01-24 15:09:23 +00:00
}
// EventLoadingFinished fired when HTTP request has finished loading.
type EventLoadingFinished struct {
2017-01-26 07:28:34 +00:00
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
EncodedDataLength float64 ` json:"encodedDataLength,omitempty" ` // Total number of bytes received for this request.
2017-01-24 15:09:23 +00:00
}
// EventLoadingFailed fired when HTTP request has failed to load.
type EventLoadingFailed struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
Type page . ResourceType ` json:"type,omitempty" ` // Resource type.
ErrorText string ` json:"errorText,omitempty" ` // User friendly error message.
Canceled bool ` json:"canceled,omitempty" ` // True if loading was canceled.
BlockedReason BlockedReason ` json:"blockedReason,omitempty" ` // The reason why loading was blocked, if any.
}
// EventWebSocketWillSendHandshakeRequest fired when WebSocket is about to
// initiate handshake.
type EventWebSocketWillSendHandshakeRequest struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
WallTime cdp . Timestamp ` json:"wallTime,omitempty" ` // UTC Timestamp.
2017-01-24 15:09:23 +00:00
Request * WebSocketRequest ` json:"request,omitempty" ` // WebSocket request data.
}
// EventWebSocketHandshakeResponseReceived fired when WebSocket handshake
// response becomes available.
type EventWebSocketHandshakeResponseReceived struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
Response * WebSocketResponse ` json:"response,omitempty" ` // WebSocket response data.
}
// EventWebSocketCreated fired upon WebSocket creation.
type EventWebSocketCreated struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
URL string ` json:"url,omitempty" ` // WebSocket request URL.
Initiator * Initiator ` json:"initiator,omitempty" ` // Request initiator.
}
// EventWebSocketClosed fired when WebSocket is closed.
type EventWebSocketClosed struct {
2017-01-26 07:28:34 +00:00
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
}
// EventWebSocketFrameReceived fired when WebSocket frame is received.
type EventWebSocketFrameReceived struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
Response * WebSocketFrame ` json:"response,omitempty" ` // WebSocket response data.
}
// EventWebSocketFrameError fired when WebSocket frame error occurs.
type EventWebSocketFrameError struct {
2017-01-26 07:28:34 +00:00
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
ErrorMessage string ` json:"errorMessage,omitempty" ` // WebSocket frame error message.
2017-01-24 15:09:23 +00:00
}
// EventWebSocketFrameSent fired when WebSocket frame is sent.
type EventWebSocketFrameSent struct {
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
2017-01-26 07:28:34 +00:00
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
2017-01-24 15:09:23 +00:00
Response * WebSocketFrame ` json:"response,omitempty" ` // WebSocket response data.
}
// EventEventSourceMessageReceived fired when EventSource message is
// received.
type EventEventSourceMessageReceived struct {
2017-01-26 07:28:34 +00:00
RequestID RequestID ` json:"requestId,omitempty" ` // Request identifier.
Timestamp cdp . Timestamp ` json:"timestamp,omitempty" ` // Timestamp.
EventName string ` json:"eventName,omitempty" ` // Message type.
EventID string ` json:"eventId,omitempty" ` // Message identifier.
Data string ` json:"data,omitempty" ` // Message content.
}
2017-06-06 10:57:18 +00:00
// EventRequestIntercepted details of an intercepted HTTP request, which must
// be either allowed, blocked, modified or mocked.
type EventRequestIntercepted struct {
InterceptionID InterceptionID ` json:"InterceptionId,omitempty" ` // Each request the page makes will have a unique id, however if any redirects are encountered while processing that fetch, they will be reported with the same id as the original fetch.
Request * Request ` json:"request,omitempty" `
RedirectHeaders * Headers ` json:"redirectHeaders,omitempty" ` // HTTP response headers, only sent if a redirect was intercepted.
RedirectStatusCode int64 ` json:"redirectStatusCode,omitempty" ` // HTTP response code, only sent if a redirect was intercepted.
RedirectURL string ` json:"redirectUrl,omitempty" ` // Redirect location, only sent if a redirect was intercepted.
}
2017-01-26 07:28:34 +00:00
// EventTypes all event types in the domain.
var EventTypes = [ ] cdp . MethodType {
cdp . EventNetworkResourceChangedPriority ,
cdp . EventNetworkRequestWillBeSent ,
cdp . EventNetworkRequestServedFromCache ,
cdp . EventNetworkResponseReceived ,
cdp . EventNetworkDataReceived ,
cdp . EventNetworkLoadingFinished ,
cdp . EventNetworkLoadingFailed ,
cdp . EventNetworkWebSocketWillSendHandshakeRequest ,
cdp . EventNetworkWebSocketHandshakeResponseReceived ,
cdp . EventNetworkWebSocketCreated ,
cdp . EventNetworkWebSocketClosed ,
cdp . EventNetworkWebSocketFrameReceived ,
cdp . EventNetworkWebSocketFrameError ,
cdp . EventNetworkWebSocketFrameSent ,
cdp . EventNetworkEventSourceMessageReceived ,
2017-06-06 10:57:18 +00:00
cdp . EventNetworkRequestIntercepted ,
2017-01-24 15:09:23 +00:00
}