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
- 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 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"` //
}
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"` //
}
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 {
Success bool `json:"success"` // Whether attach succeeded.
}
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 { TargetInfo Info `json:"targetInfo"` // WaitingForDebugger bool `json:"waitingForDebugger"` // }
AttachedToTargetReply is the reply for AttachedToTarget events.
type CloseTargetArgs ¶
type CloseTargetArgs struct {
TargetID ID `json:"targetId"` //
}
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"` //
}
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). }
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) 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"` //
}
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"` //
}
DestroyedReply is the reply for TargetDestroyed events.
type DetachFromTargetArgs ¶
type DetachFromTargetArgs struct {
TargetID ID `json:"targetId"` //
}
DetachFromTargetArgs represents the arguments for DetachFromTarget in the Target domain.
func NewDetachFromTargetArgs ¶
func NewDetachFromTargetArgs(targetID ID) *DetachFromTargetArgs
NewDetachFromTargetArgs initializes DetachFromTargetArgs with the required arguments.
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).
type DetachedFromTargetReply ¶
type DetachedFromTargetReply struct {
TargetID ID `json:"targetId"` //
}
DetachedFromTargetReply is the reply for DetachedFromTarget events.
type DisposeBrowserContextArgs ¶
type DisposeBrowserContextArgs struct {
BrowserContextID BrowserContextID `json:"browserContextId"` //
}
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"` //
}
DisposeBrowserContextReply represents the return values for DisposeBrowserContext in the Target domain.
type GetTargetInfoArgs ¶
type GetTargetInfoArgs struct {
TargetID ID `json:"targetId"` //
}
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"` //
}
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"` // Type string `json:"type"` // Title string `json:"title"` // URL string `json:"url"` // Attached bool `json:"attached"` // Whether the target has an attached client. }
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"` //
}
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 new protocol message from attached target.
type ReceivedMessageFromTargetReply ¶
type ReceivedMessageFromTargetReply struct { TargetID ID `json:"targetId"` // Message string `json:"message"` // }
ReceivedMessageFromTargetReply is the reply for ReceivedMessageFromTarget events.
type RemoteLocation ¶
RemoteLocation
type SendMessageToTargetArgs ¶
type SendMessageToTargetArgs struct { TargetID ID `json:"targetId"` // Message string `json:"message"` // }
SendMessageToTargetArgs represents the arguments for SendMessageToTarget in the Target domain.
func NewSendMessageToTargetArgs ¶
func NewSendMessageToTargetArgs(targetID ID, message string) *SendMessageToTargetArgs
NewSendMessageToTargetArgs initializes SendMessageToTargetArgs with the required arguments.
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.