Documentation ¶
Overview ¶
Package target implements the Target domain. Supports additional targets discovery and allows to attach to them.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type ActivateTargetArgs
- type AttachToTargetArgs
- type AttachToTargetReply
- type AttachedToTargetClient
- type AttachedToTargetReply
- type BrowserContextID
- type CloseTargetArgs
- type CloseTargetReply
- type CreateBrowserContextReply
- type CreateTargetArgs
- func (a *CreateTargetArgs) SetBrowserContextID(browserContextID BrowserContextID) *CreateTargetArgs
- func (a *CreateTargetArgs) SetEnableBeginFrameControl(enableBeginFrameControl bool) *CreateTargetArgs
- func (a *CreateTargetArgs) SetHeight(height int) *CreateTargetArgs
- func (a *CreateTargetArgs) SetWidth(width int) *CreateTargetArgs
- type CreateTargetReply
- type CreatedClient
- type CreatedReply
- type DestroyedClient
- type DestroyedReply
- type DetachFromTargetArgs
- type DetachedFromTargetClient
- type DetachedFromTargetReply
- type DisposeBrowserContextArgs
- type DisposeBrowserContextReply
- type GetTargetInfoArgs
- type GetTargetInfoReply
- type GetTargetsReply
- type ID
- type Info
- type InfoChangedClient
- type InfoChangedReply
- type ReceivedMessageFromTargetClient
- type ReceivedMessageFromTargetReply
- type RemoteLocation
- type SendMessageToTargetArgs
- type SessionID
- type SetAttachToFramesArgs
- type SetAutoAttachArgs
- type SetDiscoverTargetsArgs
- type SetRemoteLocationsArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActivateTargetArgs ¶
type ActivateTargetArgs struct {
TargetID ID `json:"targetId"` // No description.
}
ActivateTargetArgs represents the arguments for ActivateTarget in the Target domain.
func NewActivateTargetArgs ¶
func NewActivateTargetArgs(targetID ID) *ActivateTargetArgs
NewActivateTargetArgs initializes ActivateTargetArgs with the required arguments.
type AttachToTargetArgs ¶
type AttachToTargetArgs struct {
TargetID ID `json:"targetId"` // No description.
}
AttachToTargetArgs represents the arguments for AttachToTarget in the Target domain.
func NewAttachToTargetArgs ¶
func NewAttachToTargetArgs(targetID ID) *AttachToTargetArgs
NewAttachToTargetArgs initializes AttachToTargetArgs with the required arguments.
type AttachToTargetReply ¶
type AttachToTargetReply struct {
SessionID SessionID `json:"sessionId"` // Id assigned to the session.
}
AttachToTargetReply represents the return values for AttachToTarget in the Target domain.
type AttachedToTargetClient ¶
type AttachedToTargetClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*AttachedToTargetReply, error) rpcc.Stream }
AttachedToTargetClient is a client for AttachedToTarget events. Issued when attached to target because of auto-attach or attachToTarget command.
type AttachedToTargetReply ¶
type AttachedToTargetReply struct { SessionID SessionID `json:"sessionId"` // Identifier assigned to the session used to send/receive messages. TargetInfo Info `json:"targetInfo"` // No description. WaitingForDebugger bool `json:"waitingForDebugger"` // No description. }
AttachedToTargetReply is the reply for AttachedToTarget events.
type BrowserContextID ¶
type BrowserContextID string
BrowserContextID
Note: This type is experimental.
type CloseTargetArgs ¶
type CloseTargetArgs struct {
TargetID ID `json:"targetId"` // No description.
}
CloseTargetArgs represents the arguments for CloseTarget in the Target domain.
func NewCloseTargetArgs ¶
func NewCloseTargetArgs(targetID ID) *CloseTargetArgs
NewCloseTargetArgs initializes CloseTargetArgs with the required arguments.
type CloseTargetReply ¶
type CloseTargetReply struct {
Success bool `json:"success"` // No description.
}
CloseTargetReply represents the return values for CloseTarget in the Target domain.
type CreateBrowserContextReply ¶
type CreateBrowserContextReply struct {
BrowserContextID BrowserContextID `json:"browserContextId"` // The id of the context created.
}
CreateBrowserContextReply represents the return values for CreateBrowserContext in the Target domain.
type CreateTargetArgs ¶
type CreateTargetArgs struct { URL string `json:"url"` // The initial URL the page will be navigated to. Width *int `json:"width,omitempty"` // Frame width in DIP (headless chrome only). Height *int `json:"height,omitempty"` // Frame height in DIP (headless chrome only). BrowserContextID *BrowserContextID `json:"browserContextId,omitempty"` // The browser context to create the page in (headless chrome only). // EnableBeginFrameControl Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default). // // Note: This property is experimental. EnableBeginFrameControl *bool `json:"enableBeginFrameControl,omitempty"` }
CreateTargetArgs represents the arguments for CreateTarget in the Target domain.
func NewCreateTargetArgs ¶
func NewCreateTargetArgs(url string) *CreateTargetArgs
NewCreateTargetArgs initializes CreateTargetArgs with the required arguments.
func (*CreateTargetArgs) SetBrowserContextID ¶
func (a *CreateTargetArgs) SetBrowserContextID(browserContextID BrowserContextID) *CreateTargetArgs
SetBrowserContextID sets the BrowserContextID optional argument. The browser context to create the page in (headless chrome only).
func (*CreateTargetArgs) SetEnableBeginFrameControl ¶ added in v0.14.1
func (a *CreateTargetArgs) SetEnableBeginFrameControl(enableBeginFrameControl bool) *CreateTargetArgs
SetEnableBeginFrameControl sets the EnableBeginFrameControl optional argument. Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).
Note: This property is experimental.
func (*CreateTargetArgs) SetHeight ¶
func (a *CreateTargetArgs) SetHeight(height int) *CreateTargetArgs
SetHeight sets the Height optional argument. Frame height in DIP (headless chrome only).
func (*CreateTargetArgs) SetWidth ¶
func (a *CreateTargetArgs) SetWidth(width int) *CreateTargetArgs
SetWidth sets the Width optional argument. Frame width in DIP (headless chrome only).
type CreateTargetReply ¶
type CreateTargetReply struct {
TargetID ID `json:"targetId"` // The id of the page opened.
}
CreateTargetReply represents the return values for CreateTarget in the Target domain.
type CreatedClient ¶
type CreatedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*CreatedReply, error) rpcc.Stream }
CreatedClient is a client for TargetCreated events. Issued when a possible inspection target is created.
type CreatedReply ¶
type CreatedReply struct {
TargetInfo Info `json:"targetInfo"` // No description.
}
CreatedReply is the reply for TargetCreated events.
type DestroyedClient ¶
type DestroyedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*DestroyedReply, error) rpcc.Stream }
DestroyedClient is a client for TargetDestroyed events. Issued when a target is destroyed.
type DestroyedReply ¶
type DestroyedReply struct {
TargetID ID `json:"targetId"` // No description.
}
DestroyedReply is the reply for TargetDestroyed events.
type DetachFromTargetArgs ¶
type DetachFromTargetArgs struct { SessionID *SessionID `json:"sessionId,omitempty"` // Session to detach. // TargetID is deprecated. // // Deprecated: Deprecated. TargetID *ID `json:"targetId,omitempty"` }
DetachFromTargetArgs represents the arguments for DetachFromTarget in the Target domain.
func NewDetachFromTargetArgs ¶
func NewDetachFromTargetArgs() *DetachFromTargetArgs
NewDetachFromTargetArgs initializes DetachFromTargetArgs with the required arguments.
func (*DetachFromTargetArgs) SetSessionID ¶ added in v0.9.1
func (a *DetachFromTargetArgs) SetSessionID(sessionID SessionID) *DetachFromTargetArgs
SetSessionID sets the SessionID optional argument. Session to detach.
func (*DetachFromTargetArgs) SetTargetID
deprecated
added in
v0.9.1
func (a *DetachFromTargetArgs) SetTargetID(targetID ID) *DetachFromTargetArgs
SetTargetID sets the TargetID optional argument.
Deprecated: Deprecated.
type DetachedFromTargetClient ¶
type DetachedFromTargetClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*DetachedFromTargetReply, error) rpcc.Stream }
DetachedFromTargetClient is a client for DetachedFromTarget events. Issued when detached from target for any reason (including detachFromTarget command). Can be issued multiple times per target if multiple sessions have been attached to it.
type DetachedFromTargetReply ¶
type DetachedFromTargetReply struct { SessionID SessionID `json:"sessionId"` // Detached session identifier. // TargetID is deprecated. // // Deprecated: Deprecated. TargetID *ID `json:"targetId,omitempty"` }
DetachedFromTargetReply is the reply for DetachedFromTarget events.
type DisposeBrowserContextArgs ¶
type DisposeBrowserContextArgs struct {
BrowserContextID BrowserContextID `json:"browserContextId"` // No description.
}
DisposeBrowserContextArgs represents the arguments for DisposeBrowserContext in the Target domain.
func NewDisposeBrowserContextArgs ¶
func NewDisposeBrowserContextArgs(browserContextID BrowserContextID) *DisposeBrowserContextArgs
NewDisposeBrowserContextArgs initializes DisposeBrowserContextArgs with the required arguments.
type DisposeBrowserContextReply ¶
type DisposeBrowserContextReply struct {
Success bool `json:"success"` // No description.
}
DisposeBrowserContextReply represents the return values for DisposeBrowserContext in the Target domain.
type GetTargetInfoArgs ¶
type GetTargetInfoArgs struct {
TargetID ID `json:"targetId"` // No description.
}
GetTargetInfoArgs represents the arguments for GetTargetInfo in the Target domain.
func NewGetTargetInfoArgs ¶
func NewGetTargetInfoArgs(targetID ID) *GetTargetInfoArgs
NewGetTargetInfoArgs initializes GetTargetInfoArgs with the required arguments.
type GetTargetInfoReply ¶
type GetTargetInfoReply struct {
TargetInfo Info `json:"targetInfo"` // No description.
}
GetTargetInfoReply represents the return values for GetTargetInfo in the Target domain.
type GetTargetsReply ¶
type GetTargetsReply struct {
TargetInfos []Info `json:"targetInfos"` // The list of targets.
}
GetTargetsReply represents the return values for GetTargets in the Target domain.
type Info ¶
type Info struct { TargetID ID `json:"targetId"` // No description. Type string `json:"type"` // No description. Title string `json:"title"` // No description. URL string `json:"url"` // No description. Attached bool `json:"attached"` // Whether the target has an attached client. OpenerID *ID `json:"openerId,omitempty"` // Opener target Id }
Info
type InfoChangedClient ¶
type InfoChangedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*InfoChangedReply, error) rpcc.Stream }
InfoChangedClient is a client for TargetInfoChanged events. Issued when some information about a target has changed. This only happens between targetCreated and targetDestroyed.
type InfoChangedReply ¶
type InfoChangedReply struct {
TargetInfo Info `json:"targetInfo"` // No description.
}
InfoChangedReply is the reply for TargetInfoChanged events.
type ReceivedMessageFromTargetClient ¶
type ReceivedMessageFromTargetClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ReceivedMessageFromTargetReply, error) rpcc.Stream }
ReceivedMessageFromTargetClient is a client for ReceivedMessageFromTarget events. Notifies about a new protocol message received from the session (as reported in attachedToTarget event).
type ReceivedMessageFromTargetReply ¶
type ReceivedMessageFromTargetReply struct { SessionID SessionID `json:"sessionId"` // Identifier of a session which sends a message. Message json.RawMessage `json:"message"` // No description. // TargetID is deprecated. // // Deprecated: Deprecated. TargetID *ID `json:"targetId,omitempty"` }
ReceivedMessageFromTargetReply is the reply for ReceivedMessageFromTarget events.
type RemoteLocation ¶
type RemoteLocation struct { Host string `json:"host"` // No description. Port int `json:"port"` // No description. }
RemoteLocation
Note: This type is experimental.
type SendMessageToTargetArgs ¶
type SendMessageToTargetArgs struct { Message json.RawMessage `json:"message"` // No description. SessionID *SessionID `json:"sessionId,omitempty"` // Identifier of the session. // TargetID is deprecated. // // Deprecated: Deprecated. TargetID *ID `json:"targetId,omitempty"` }
SendMessageToTargetArgs represents the arguments for SendMessageToTarget in the Target domain.
func NewSendMessageToTargetArgs ¶
func NewSendMessageToTargetArgs(message json.RawMessage) *SendMessageToTargetArgs
NewSendMessageToTargetArgs initializes SendMessageToTargetArgs with the required arguments.
func (*SendMessageToTargetArgs) SetSessionID ¶ added in v0.9.1
func (a *SendMessageToTargetArgs) SetSessionID(sessionID SessionID) *SendMessageToTargetArgs
SetSessionID sets the SessionID optional argument. Identifier of the session.
func (*SendMessageToTargetArgs) SetTargetID
deprecated
added in
v0.9.1
func (a *SendMessageToTargetArgs) SetTargetID(targetID ID) *SendMessageToTargetArgs
SetTargetID sets the TargetID optional argument.
Deprecated: Deprecated.
type SessionID ¶ added in v0.9.1
type SessionID string
SessionID Unique identifier of attached debugging session.
type SetAttachToFramesArgs ¶
type SetAttachToFramesArgs struct {
Value bool `json:"value"` // Whether to attach to frames.
}
SetAttachToFramesArgs represents the arguments for SetAttachToFrames in the Target domain.
func NewSetAttachToFramesArgs ¶
func NewSetAttachToFramesArgs(value bool) *SetAttachToFramesArgs
NewSetAttachToFramesArgs initializes SetAttachToFramesArgs with the required arguments.
type SetAutoAttachArgs ¶
type SetAutoAttachArgs struct { AutoAttach bool `json:"autoAttach"` // Whether to auto-attach to related targets. WaitForDebuggerOnStart bool `json:"waitForDebuggerOnStart"` // Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. }
SetAutoAttachArgs represents the arguments for SetAutoAttach in the Target domain.
func NewSetAutoAttachArgs ¶
func NewSetAutoAttachArgs(autoAttach bool, waitForDebuggerOnStart bool) *SetAutoAttachArgs
NewSetAutoAttachArgs initializes SetAutoAttachArgs with the required arguments.
type SetDiscoverTargetsArgs ¶
type SetDiscoverTargetsArgs struct {
Discover bool `json:"discover"` // Whether to discover available targets.
}
SetDiscoverTargetsArgs represents the arguments for SetDiscoverTargets in the Target domain.
func NewSetDiscoverTargetsArgs ¶
func NewSetDiscoverTargetsArgs(discover bool) *SetDiscoverTargetsArgs
NewSetDiscoverTargetsArgs initializes SetDiscoverTargetsArgs with the required arguments.
type SetRemoteLocationsArgs ¶
type SetRemoteLocationsArgs struct {
Locations []RemoteLocation `json:"locations"` // List of remote locations.
}
SetRemoteLocationsArgs represents the arguments for SetRemoteLocations in the Target domain.
func NewSetRemoteLocationsArgs ¶
func NewSetRemoteLocationsArgs(locations []RemoteLocation) *SetRemoteLocationsArgs
NewSetRemoteLocationsArgs initializes SetRemoteLocationsArgs with the required arguments.