Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type ActionResult
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ComputerCaptureScreenshotParams
- type ComputerChangeProxyParams
- type ComputerClickParams
- type ComputerDebugParams
- type ComputerDoubleClickParams
- type ComputerDragParams
- type ComputerExecExecuteParams
- type ComputerExecExecuteResponse
- type ComputerExecExecuteSyncParams
- type ComputerExecExecuteSyncResponse
- type ComputerExecService
- func (r *ComputerExecService) ExecuteStreaming(ctx context.Context, id string, body ComputerExecExecuteParams, ...) (stream *jsonl.Stream[ComputerExecExecuteResponse])
- func (r *ComputerExecService) ExecuteSync(ctx context.Context, id string, body ComputerExecExecuteSyncParams, ...) (res *ComputerExecExecuteSyncResponse, err error)
- type ComputerExecuteActionParams
- type ComputerExecuteActionParamsAction
- type ComputerExecuteActionParamsActionDebug
- type ComputerExecuteBatchParams
- type ComputerExecuteBatchParamsAction
- type ComputerExecuteBatchParamsActionDebug
- type ComputerExecuteBatchResponse
- type ComputerGetHTMLParams
- type ComputerGetStatusResponse
- type ComputerKeepAliveResponse
- type ComputerKeyDownParams
- type ComputerKeyUpParams
- type ComputerMouseDownParams
- type ComputerMouseUpParams
- type ComputerNavigateParams
- type ComputerNewParams
- type ComputerNewParamsDisplay
- type ComputerPressHotkeyParams
- type ComputerResponse
- type ComputerRightClickParams
- type ComputerScrollViewportParams
- type ComputerService
- func (r *ComputerService) CaptureScreenshot(ctx context.Context, id string, body ComputerCaptureScreenshotParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) ChangeProxy(ctx context.Context, id string, body ComputerChangeProxyParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) Click(ctx context.Context, id string, body ComputerClickParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) ConnectWebsocket(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *ComputerService) Debug(ctx context.Context, id string, body ComputerDebugParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) DoubleClick(ctx context.Context, id string, body ComputerDoubleClickParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) Drag(ctx context.Context, id string, body ComputerDragParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) ExecuteAction(ctx context.Context, id string, body ComputerExecuteActionParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) ExecuteBatch(ctx context.Context, id string, body ComputerExecuteBatchParams, ...) (res *ComputerExecuteBatchResponse, err error)
- func (r *ComputerService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *ComputerResponse, err error)
- func (r *ComputerService) GetHTML(ctx context.Context, id string, body ComputerGetHTMLParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) GetStatus(ctx context.Context, id string, opts ...option.RequestOption) (res *ComputerGetStatusResponse, err error)
- func (r *ComputerService) KeepAlive(ctx context.Context, id string, opts ...option.RequestOption) (res *ComputerKeepAliveResponse, err error)
- func (r *ComputerService) KeyDown(ctx context.Context, id string, body ComputerKeyDownParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) KeyUp(ctx context.Context, id string, body ComputerKeyUpParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ComputerResponse, err error)
- func (r *ComputerService) MouseDown(ctx context.Context, id string, body ComputerMouseDownParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) MouseUp(ctx context.Context, id string, body ComputerMouseUpParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) Navigate(ctx context.Context, id string, body ComputerNavigateParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) New(ctx context.Context, body ComputerNewParams, opts ...option.RequestOption) (res *ComputerResponse, err error)
- func (r *ComputerService) PressHotkey(ctx context.Context, id string, body ComputerPressHotkeyParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) RightClick(ctx context.Context, id string, body ComputerRightClickParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) ScrollViewport(ctx context.Context, id string, body ComputerScrollViewportParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) SetViewport(ctx context.Context, id string, body ComputerSetViewportParams, ...) (res *ActionResult, err error)
- func (r *ComputerService) StreamEvents(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *ComputerService) StreamScreencast(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *ComputerService) Terminate(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *ComputerService) TypeText(ctx context.Context, id string, body ComputerTypeTextParams, ...) (res *ActionResult, err error)
- type ComputerSetViewportParams
- type ComputerTabDeleteParams
- type ComputerTabNewParams
- type ComputerTabService
- func (r *ComputerTabService) Delete(ctx context.Context, tabID string, body ComputerTabDeleteParams, ...) (res *ActionResult, err error)
- func (r *ComputerTabService) List(ctx context.Context, id string, opts ...option.RequestOption) (res *ActionResult, err error)
- func (r *ComputerTabService) New(ctx context.Context, id string, body ComputerTabNewParams, ...) (res *ActionResult, err error)
- func (r *ComputerTabService) Switch(ctx context.Context, tabID string, body ComputerTabSwitchParams, ...) (res *ActionResult, err error)
- type ComputerTabSwitchParams
- type ComputerTypeTextParams
- type Error
- type V2GoBackendInternalTypesPageContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (TZAFON_API_KEY, COMPUTER_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type ActionResult ¶
type ActionResult struct {
ErrorMessage string `json:"error_message"`
ExecutedTabID string `json:"executed_tab_id"`
PageContext V2GoBackendInternalTypesPageContext `json:"page_context"`
RequestID string `json:"request_id"`
Result map[string]any `json:"result"`
Status string `json:"status"`
Timestamp string `json:"timestamp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ErrorMessage respjson.Field
ExecutedTabID respjson.Field
PageContext respjson.Field
RequestID respjson.Field
Result respjson.Field
Status respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ActionResult) RawJSON ¶
func (r ActionResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionResult) UnmarshalJSON ¶
func (r *ActionResult) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
Computers ComputerService
}
Client creates a struct with services and top level methods that help with interacting with the computer API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (TZAFON_API_KEY, COMPUTER_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned [url.Values] will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ComputerCaptureScreenshotParams ¶
type ComputerCaptureScreenshotParams struct {
Base64 param.Opt[bool] `json:"base64,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
// contains filtered or unexported fields
}
func (ComputerCaptureScreenshotParams) MarshalJSON ¶
func (r ComputerCaptureScreenshotParams) MarshalJSON() (data []byte, err error)
func (*ComputerCaptureScreenshotParams) UnmarshalJSON ¶
func (r *ComputerCaptureScreenshotParams) UnmarshalJSON(data []byte) error
type ComputerChangeProxyParams ¶
type ComputerChangeProxyParams struct {
ProxyURL param.Opt[string] `json:"proxy_url,omitzero"`
// contains filtered or unexported fields
}
func (ComputerChangeProxyParams) MarshalJSON ¶
func (r ComputerChangeProxyParams) MarshalJSON() (data []byte, err error)
func (*ComputerChangeProxyParams) UnmarshalJSON ¶
func (r *ComputerChangeProxyParams) UnmarshalJSON(data []byte) error
type ComputerClickParams ¶
type ComputerClickParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
// contains filtered or unexported fields
}
func (ComputerClickParams) MarshalJSON ¶
func (r ComputerClickParams) MarshalJSON() (data []byte, err error)
func (*ComputerClickParams) UnmarshalJSON ¶
func (r *ComputerClickParams) UnmarshalJSON(data []byte) error
type ComputerDebugParams ¶
type ComputerDebugParams struct {
Command param.Opt[string] `json:"command,omitzero"`
MaxOutputLength param.Opt[int64] `json:"max_output_length,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
func (ComputerDebugParams) MarshalJSON ¶
func (r ComputerDebugParams) MarshalJSON() (data []byte, err error)
func (*ComputerDebugParams) UnmarshalJSON ¶
func (r *ComputerDebugParams) UnmarshalJSON(data []byte) error
type ComputerDoubleClickParams ¶
type ComputerDoubleClickParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
// contains filtered or unexported fields
}
func (ComputerDoubleClickParams) MarshalJSON ¶
func (r ComputerDoubleClickParams) MarshalJSON() (data []byte, err error)
func (*ComputerDoubleClickParams) UnmarshalJSON ¶
func (r *ComputerDoubleClickParams) UnmarshalJSON(data []byte) error
type ComputerDragParams ¶
type ComputerDragParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
X1 param.Opt[float64] `json:"x1,omitzero"`
X2 param.Opt[float64] `json:"x2,omitzero"`
Y1 param.Opt[float64] `json:"y1,omitzero"`
Y2 param.Opt[float64] `json:"y2,omitzero"`
// contains filtered or unexported fields
}
func (ComputerDragParams) MarshalJSON ¶
func (r ComputerDragParams) MarshalJSON() (data []byte, err error)
func (*ComputerDragParams) UnmarshalJSON ¶
func (r *ComputerDragParams) UnmarshalJSON(data []byte) error
type ComputerExecExecuteParams ¶
type ComputerExecExecuteParams struct {
Command param.Opt[string] `json:"command,omitzero"`
Cwd param.Opt[string] `json:"cwd,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
Env map[string]string `json:"env,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecExecuteParams) MarshalJSON ¶
func (r ComputerExecExecuteParams) MarshalJSON() (data []byte, err error)
func (*ComputerExecExecuteParams) UnmarshalJSON ¶
func (r *ComputerExecExecuteParams) UnmarshalJSON(data []byte) error
type ComputerExecExecuteResponse ¶
type ComputerExecExecuteResponse struct {
// for exit
Code int64 `json:"code"`
// for stdout/stderr
Data string `json:"data"`
// for error
Message string `json:"message"`
// "stdout", "stderr", "exit", "error"
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Data respjson.Field
Message respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ComputerExecExecuteResponse) RawJSON ¶
func (r ComputerExecExecuteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ComputerExecExecuteResponse) UnmarshalJSON ¶
func (r *ComputerExecExecuteResponse) UnmarshalJSON(data []byte) error
type ComputerExecExecuteSyncParams ¶
type ComputerExecExecuteSyncParams struct {
Command param.Opt[string] `json:"command,omitzero"`
Cwd param.Opt[string] `json:"cwd,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
Env map[string]string `json:"env,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecExecuteSyncParams) MarshalJSON ¶
func (r ComputerExecExecuteSyncParams) MarshalJSON() (data []byte, err error)
func (*ComputerExecExecuteSyncParams) UnmarshalJSON ¶
func (r *ComputerExecExecuteSyncParams) UnmarshalJSON(data []byte) error
type ComputerExecExecuteSyncResponse ¶
type ComputerExecExecuteSyncResponse struct {
ExitCode int64 `json:"exit_code"`
Stderr string `json:"stderr"`
Stdout string `json:"stdout"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExitCode respjson.Field
Stderr respjson.Field
Stdout respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ComputerExecExecuteSyncResponse) RawJSON ¶
func (r ComputerExecExecuteSyncResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ComputerExecExecuteSyncResponse) UnmarshalJSON ¶
func (r *ComputerExecExecuteSyncResponse) UnmarshalJSON(data []byte) error
type ComputerExecService ¶
type ComputerExecService struct {
Options []option.RequestOption
}
ComputerExecService contains methods and other services that help with interacting with the computer API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputerExecService method instead.
func NewComputerExecService ¶
func NewComputerExecService(opts ...option.RequestOption) (r ComputerExecService)
NewComputerExecService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ComputerExecService) ExecuteStreaming ¶
func (r *ComputerExecService) ExecuteStreaming(ctx context.Context, id string, body ComputerExecExecuteParams, opts ...option.RequestOption) (stream *jsonl.Stream[ComputerExecExecuteResponse])
Execute a shell command with real-time streaming output as NDJSON. Each line is a JSON object with type (stdout/stderr/exit/error).
func (*ComputerExecService) ExecuteSync ¶
func (r *ComputerExecService) ExecuteSync(ctx context.Context, id string, body ComputerExecExecuteSyncParams, opts ...option.RequestOption) (res *ComputerExecExecuteSyncResponse, err error)
Execute a shell command and wait for completion, returning buffered stdout/stderr.
type ComputerExecuteActionParams ¶
type ComputerExecuteActionParams struct {
Action ComputerExecuteActionParamsAction `json:"action,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecuteActionParams) MarshalJSON ¶
func (r ComputerExecuteActionParams) MarshalJSON() (data []byte, err error)
func (*ComputerExecuteActionParams) UnmarshalJSON ¶
func (r *ComputerExecuteActionParams) UnmarshalJSON(data []byte) error
type ComputerExecuteActionParamsAction ¶
type ComputerExecuteActionParamsAction struct {
// For get_html_content
AutoDetectEncoding param.Opt[bool] `json:"auto_detect_encoding,omitzero"`
// For screenshot
Base64 param.Opt[bool] `json:"base64,omitzero"`
Button param.Opt[string] `json:"button,omitzero"`
// For scrolling
Dx param.Opt[float64] `json:"dx,omitzero"`
Dy param.Opt[float64] `json:"dy,omitzero"`
Height param.Opt[int64] `json:"height,omitzero"`
// Include page context in response
IncludeContext param.Opt[bool] `json:"include_context,omitzero"`
// For key_down/key_up
Key param.Opt[string] `json:"key,omitzero"`
Ms param.Opt[int64] `json:"ms,omitzero"`
ProxyURL param.Opt[string] `json:"proxy_url,omitzero"`
// RequestId is used for correlating streaming output to the originating request.
// Set on ActionRequest, not individual action types.
RequestID param.Opt[string] `json:"request_id,omitzero"`
ScaleFactor param.Opt[float64] `json:"scale_factor,omitzero"`
// For tab management (browser sessions only)
TabID param.Opt[string] `json:"tab_id,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up
Type param.Opt[string] `json:"type,omitzero"`
URL param.Opt[string] `json:"url,omitzero"`
// For set_viewport
Width param.Opt[int64] `json:"width,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
// For dragging/scrolling
X1 param.Opt[float64] `json:"x1,omitzero"`
// For dragging
X2 param.Opt[float64] `json:"x2,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
Y1 param.Opt[float64] `json:"y1,omitzero"`
Y2 param.Opt[float64] `json:"y2,omitzero"`
Debug ComputerExecuteActionParamsActionDebug `json:"debug,omitzero"`
Keys []string `json:"keys,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecuteActionParamsAction) MarshalJSON ¶
func (r ComputerExecuteActionParamsAction) MarshalJSON() (data []byte, err error)
func (*ComputerExecuteActionParamsAction) UnmarshalJSON ¶
func (r *ComputerExecuteActionParamsAction) UnmarshalJSON(data []byte) error
type ComputerExecuteActionParamsActionDebug ¶
type ComputerExecuteActionParamsActionDebug struct {
Command param.Opt[string] `json:"command,omitzero"`
Cwd param.Opt[string] `json:"cwd,omitzero"`
MaxOutputLength param.Opt[int64] `json:"max_output_length,omitzero"`
RequestID param.Opt[string] `json:"request_id,omitzero"`
Stream param.Opt[bool] `json:"stream,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
Env map[string]string `json:"env,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecuteActionParamsActionDebug) MarshalJSON ¶
func (r ComputerExecuteActionParamsActionDebug) MarshalJSON() (data []byte, err error)
func (*ComputerExecuteActionParamsActionDebug) UnmarshalJSON ¶
func (r *ComputerExecuteActionParamsActionDebug) UnmarshalJSON(data []byte) error
type ComputerExecuteBatchParams ¶
type ComputerExecuteBatchParams struct {
Actions []ComputerExecuteBatchParamsAction `json:"actions,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecuteBatchParams) MarshalJSON ¶
func (r ComputerExecuteBatchParams) MarshalJSON() (data []byte, err error)
func (*ComputerExecuteBatchParams) UnmarshalJSON ¶
func (r *ComputerExecuteBatchParams) UnmarshalJSON(data []byte) error
type ComputerExecuteBatchParamsAction ¶
type ComputerExecuteBatchParamsAction struct {
// For get_html_content
AutoDetectEncoding param.Opt[bool] `json:"auto_detect_encoding,omitzero"`
// For screenshot
Base64 param.Opt[bool] `json:"base64,omitzero"`
Button param.Opt[string] `json:"button,omitzero"`
// For scrolling
Dx param.Opt[float64] `json:"dx,omitzero"`
Dy param.Opt[float64] `json:"dy,omitzero"`
Height param.Opt[int64] `json:"height,omitzero"`
// Include page context in response
IncludeContext param.Opt[bool] `json:"include_context,omitzero"`
// For key_down/key_up
Key param.Opt[string] `json:"key,omitzero"`
Ms param.Opt[int64] `json:"ms,omitzero"`
ProxyURL param.Opt[string] `json:"proxy_url,omitzero"`
// RequestId is used for correlating streaming output to the originating request.
// Set on ActionRequest, not individual action types.
RequestID param.Opt[string] `json:"request_id,omitzero"`
ScaleFactor param.Opt[float64] `json:"scale_factor,omitzero"`
// For tab management (browser sessions only)
TabID param.Opt[string] `json:"tab_id,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up
Type param.Opt[string] `json:"type,omitzero"`
URL param.Opt[string] `json:"url,omitzero"`
// For set_viewport
Width param.Opt[int64] `json:"width,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
// For dragging/scrolling
X1 param.Opt[float64] `json:"x1,omitzero"`
// For dragging
X2 param.Opt[float64] `json:"x2,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
Y1 param.Opt[float64] `json:"y1,omitzero"`
Y2 param.Opt[float64] `json:"y2,omitzero"`
Debug ComputerExecuteBatchParamsActionDebug `json:"debug,omitzero"`
Keys []string `json:"keys,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecuteBatchParamsAction) MarshalJSON ¶
func (r ComputerExecuteBatchParamsAction) MarshalJSON() (data []byte, err error)
func (*ComputerExecuteBatchParamsAction) UnmarshalJSON ¶
func (r *ComputerExecuteBatchParamsAction) UnmarshalJSON(data []byte) error
type ComputerExecuteBatchParamsActionDebug ¶
type ComputerExecuteBatchParamsActionDebug struct {
Command param.Opt[string] `json:"command,omitzero"`
Cwd param.Opt[string] `json:"cwd,omitzero"`
MaxOutputLength param.Opt[int64] `json:"max_output_length,omitzero"`
RequestID param.Opt[string] `json:"request_id,omitzero"`
Stream param.Opt[bool] `json:"stream,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
Env map[string]string `json:"env,omitzero"`
// contains filtered or unexported fields
}
func (ComputerExecuteBatchParamsActionDebug) MarshalJSON ¶
func (r ComputerExecuteBatchParamsActionDebug) MarshalJSON() (data []byte, err error)
func (*ComputerExecuteBatchParamsActionDebug) UnmarshalJSON ¶
func (r *ComputerExecuteBatchParamsActionDebug) UnmarshalJSON(data []byte) error
type ComputerGetHTMLParams ¶
type ComputerGetHTMLParams struct {
AutoDetectEncoding param.Opt[bool] `json:"auto_detect_encoding,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
// contains filtered or unexported fields
}
func (ComputerGetHTMLParams) MarshalJSON ¶
func (r ComputerGetHTMLParams) MarshalJSON() (data []byte, err error)
func (*ComputerGetHTMLParams) UnmarshalJSON ¶
func (r *ComputerGetHTMLParams) UnmarshalJSON(data []byte) error
type ComputerGetStatusResponse ¶
type ComputerGetStatusResponse struct {
ID string `json:"id"`
AutoKill bool `json:"auto_kill"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
IdleExpiresAt string `json:"idle_expires_at"`
InactivityTimeoutSeconds int64 `json:"inactivity_timeout_seconds"`
LastActivityAt string `json:"last_activity_at"`
MaxLifetimeSeconds int64 `json:"max_lifetime_seconds"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AutoKill respjson.Field
CreatedAt respjson.Field
ExpiresAt respjson.Field
IdleExpiresAt respjson.Field
InactivityTimeoutSeconds respjson.Field
LastActivityAt respjson.Field
MaxLifetimeSeconds respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ComputerGetStatusResponse) RawJSON ¶
func (r ComputerGetStatusResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ComputerGetStatusResponse) UnmarshalJSON ¶
func (r *ComputerGetStatusResponse) UnmarshalJSON(data []byte) error
type ComputerKeyDownParams ¶
type ComputerKeyDownParams struct {
Key param.Opt[string] `json:"key,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
// contains filtered or unexported fields
}
func (ComputerKeyDownParams) MarshalJSON ¶
func (r ComputerKeyDownParams) MarshalJSON() (data []byte, err error)
func (*ComputerKeyDownParams) UnmarshalJSON ¶
func (r *ComputerKeyDownParams) UnmarshalJSON(data []byte) error
type ComputerKeyUpParams ¶
type ComputerKeyUpParams struct {
Key param.Opt[string] `json:"key,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
// contains filtered or unexported fields
}
func (ComputerKeyUpParams) MarshalJSON ¶
func (r ComputerKeyUpParams) MarshalJSON() (data []byte, err error)
func (*ComputerKeyUpParams) UnmarshalJSON ¶
func (r *ComputerKeyUpParams) UnmarshalJSON(data []byte) error
type ComputerMouseDownParams ¶
type ComputerMouseDownParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
// contains filtered or unexported fields
}
func (ComputerMouseDownParams) MarshalJSON ¶
func (r ComputerMouseDownParams) MarshalJSON() (data []byte, err error)
func (*ComputerMouseDownParams) UnmarshalJSON ¶
func (r *ComputerMouseDownParams) UnmarshalJSON(data []byte) error
type ComputerMouseUpParams ¶
type ComputerMouseUpParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
// contains filtered or unexported fields
}
func (ComputerMouseUpParams) MarshalJSON ¶
func (r ComputerMouseUpParams) MarshalJSON() (data []byte, err error)
func (*ComputerMouseUpParams) UnmarshalJSON ¶
func (r *ComputerMouseUpParams) UnmarshalJSON(data []byte) error
type ComputerNavigateParams ¶
type ComputerNavigateParams struct {
// contains filtered or unexported fields
}
func (ComputerNavigateParams) MarshalJSON ¶
func (r ComputerNavigateParams) MarshalJSON() (data []byte, err error)
func (*ComputerNavigateParams) UnmarshalJSON ¶
func (r *ComputerNavigateParams) UnmarshalJSON(data []byte) error
type ComputerNewParams ¶
type ComputerNewParams struct {
// If true (default), kill session after inactivity
AutoKill param.Opt[bool] `json:"auto_kill,omitzero"`
ContextID param.Opt[string] `json:"context_id,omitzero"`
// Idle timeout before auto-kill
InactivityTimeoutSeconds param.Opt[int64] `json:"inactivity_timeout_seconds,omitzero"`
// "browser" (default) or "desktop"
Kind param.Opt[string] `json:"kind,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
Display ComputerNewParamsDisplay `json:"display,omitzero"`
Stealth any `json:"stealth,omitzero"`
// contains filtered or unexported fields
}
func (ComputerNewParams) MarshalJSON ¶
func (r ComputerNewParams) MarshalJSON() (data []byte, err error)
func (*ComputerNewParams) UnmarshalJSON ¶
func (r *ComputerNewParams) UnmarshalJSON(data []byte) error
type ComputerNewParamsDisplay ¶
type ComputerNewParamsDisplay struct {
Height param.Opt[int64] `json:"height,omitzero"`
Scale param.Opt[float64] `json:"scale,omitzero"`
Width param.Opt[int64] `json:"width,omitzero"`
// contains filtered or unexported fields
}
func (ComputerNewParamsDisplay) MarshalJSON ¶
func (r ComputerNewParamsDisplay) MarshalJSON() (data []byte, err error)
func (*ComputerNewParamsDisplay) UnmarshalJSON ¶
func (r *ComputerNewParamsDisplay) UnmarshalJSON(data []byte) error
type ComputerPressHotkeyParams ¶
type ComputerPressHotkeyParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
Keys []string `json:"keys,omitzero"`
// contains filtered or unexported fields
}
func (ComputerPressHotkeyParams) MarshalJSON ¶
func (r ComputerPressHotkeyParams) MarshalJSON() (data []byte, err error)
func (*ComputerPressHotkeyParams) UnmarshalJSON ¶
func (r *ComputerPressHotkeyParams) UnmarshalJSON(data []byte) error
type ComputerResponse ¶
type ComputerResponse struct {
ID string `json:"id"`
AutoKill bool `json:"auto_kill"`
CreatedAt string `json:"created_at"`
Endpoints map[string]string `json:"endpoints"`
ExpiresAt string `json:"expires_at"`
IdleExpiresAt string `json:"idle_expires_at"`
InactivityTimeoutSeconds int64 `json:"inactivity_timeout_seconds"`
Kind string `json:"kind"`
LastActivityAt string `json:"last_activity_at"`
MaxLifetimeSeconds int64 `json:"max_lifetime_seconds"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AutoKill respjson.Field
CreatedAt respjson.Field
Endpoints respjson.Field
ExpiresAt respjson.Field
IdleExpiresAt respjson.Field
InactivityTimeoutSeconds respjson.Field
Kind respjson.Field
LastActivityAt respjson.Field
MaxLifetimeSeconds respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ComputerResponse) RawJSON ¶
func (r ComputerResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ComputerResponse) UnmarshalJSON ¶
func (r *ComputerResponse) UnmarshalJSON(data []byte) error
type ComputerRightClickParams ¶
type ComputerRightClickParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
// contains filtered or unexported fields
}
func (ComputerRightClickParams) MarshalJSON ¶
func (r ComputerRightClickParams) MarshalJSON() (data []byte, err error)
func (*ComputerRightClickParams) UnmarshalJSON ¶
func (r *ComputerRightClickParams) UnmarshalJSON(data []byte) error
type ComputerScrollViewportParams ¶
type ComputerScrollViewportParams struct {
Dx param.Opt[float64] `json:"dx,omitzero"`
Dy param.Opt[float64] `json:"dy,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
X param.Opt[float64] `json:"x,omitzero"`
Y param.Opt[float64] `json:"y,omitzero"`
// contains filtered or unexported fields
}
func (ComputerScrollViewportParams) MarshalJSON ¶
func (r ComputerScrollViewportParams) MarshalJSON() (data []byte, err error)
func (*ComputerScrollViewportParams) UnmarshalJSON ¶
func (r *ComputerScrollViewportParams) UnmarshalJSON(data []byte) error
type ComputerService ¶
type ComputerService struct {
Options []option.RequestOption
Tabs ComputerTabService
Exec ComputerExecService
}
ComputerService contains methods and other services that help with interacting with the computer API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputerService method instead.
func NewComputerService ¶
func NewComputerService(opts ...option.RequestOption) (r ComputerService)
NewComputerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ComputerService) CaptureScreenshot ¶
func (r *ComputerService) CaptureScreenshot(ctx context.Context, id string, body ComputerCaptureScreenshotParams, opts ...option.RequestOption) (res *ActionResult, err error)
Take a screenshot of the current browser viewport, optionally as base64. Optionally specify tab_id (browser sessions only)
func (*ComputerService) ChangeProxy ¶
func (r *ComputerService) ChangeProxy(ctx context.Context, id string, body ComputerChangeProxyParams, opts ...option.RequestOption) (res *ActionResult, err error)
Change the proxy settings for the browser session
func (*ComputerService) Click ¶
func (r *ComputerService) Click(ctx context.Context, id string, body ComputerClickParams, opts ...option.RequestOption) (res *ActionResult, err error)
Perform a left mouse click at the specified x,y coordinates. Coordinates are screenshot pixel positions - send exactly what you see in the screenshot/screencast image. If target is at pixel (500, 300) in the image, send x=500, y=300. Optionally specify tab_id (browser sessions only)
func (*ComputerService) ConnectWebsocket ¶
func (r *ComputerService) ConnectWebsocket(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Establish WebSocket for real-time bidirectional communication
func (*ComputerService) Debug ¶
func (r *ComputerService) Debug(ctx context.Context, id string, body ComputerDebugParams, opts ...option.RequestOption) (res *ActionResult, err error)
Execute a shell command with optional timeout and output length limits. Optionally specify tab_id (browser sessions only). Deprecated: use /exec or /exec/sync instead.
func (*ComputerService) DoubleClick ¶
func (r *ComputerService) DoubleClick(ctx context.Context, id string, body ComputerDoubleClickParams, opts ...option.RequestOption) (res *ActionResult, err error)
Perform a double mouse click at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) Drag ¶
func (r *ComputerService) Drag(ctx context.Context, id string, body ComputerDragParams, opts ...option.RequestOption) (res *ActionResult, err error)
Perform a click-and-drag action from (x1,y1) to (x2,y2). Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) ExecuteAction ¶
func (r *ComputerService) ExecuteAction(ctx context.Context, id string, body ComputerExecuteActionParams, opts ...option.RequestOption) (res *ActionResult, err error)
Execute a single action such as screenshot, click, type, navigate, scroll, debug, set_viewport, get_html_content or other computer use actions
func (*ComputerService) ExecuteBatch ¶
func (r *ComputerService) ExecuteBatch(ctx context.Context, id string, body ComputerExecuteBatchParams, opts ...option.RequestOption) (res *ComputerExecuteBatchResponse, err error)
Execute a batch of actions in sequence, stopping on first error
func (*ComputerService) Get ¶
func (r *ComputerService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *ComputerResponse, err error)
Get the current status and metadata of a computer instance
func (*ComputerService) GetHTML ¶
func (r *ComputerService) GetHTML(ctx context.Context, id string, body ComputerGetHTMLParams, opts ...option.RequestOption) (res *ActionResult, err error)
Get the HTML content of the current browser page. Optionally specify tab_id (browser sessions only)
func (*ComputerService) GetStatus ¶
func (r *ComputerService) GetStatus(ctx context.Context, id string, opts ...option.RequestOption) (res *ComputerGetStatusResponse, err error)
Get current TTLs and last activity metadata for a computer session
func (*ComputerService) KeepAlive ¶
func (r *ComputerService) KeepAlive(ctx context.Context, id string, opts ...option.RequestOption) (res *ComputerKeepAliveResponse, err error)
Extend the timeout for a computer session and verify it is still running
func (*ComputerService) KeyDown ¶
func (r *ComputerService) KeyDown(ctx context.Context, id string, body ComputerKeyDownParams, opts ...option.RequestOption) (res *ActionResult, err error)
Press and hold a keyboard key. Use with key_up for complex interactions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) KeyUp ¶
func (r *ComputerService) KeyUp(ctx context.Context, id string, body ComputerKeyUpParams, opts ...option.RequestOption) (res *ActionResult, err error)
Release a keyboard key that was previously pressed with key_down. Optionally specify tab_id (browser sessions only)
func (*ComputerService) List ¶
func (r *ComputerService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ComputerResponse, err error)
List all active computers for the user's organization
func (*ComputerService) MouseDown ¶
func (r *ComputerService) MouseDown(ctx context.Context, id string, body ComputerMouseDownParams, opts ...option.RequestOption) (res *ActionResult, err error)
Press and hold the left mouse button at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) MouseUp ¶
func (r *ComputerService) MouseUp(ctx context.Context, id string, body ComputerMouseUpParams, opts ...option.RequestOption) (res *ActionResult, err error)
Release the left mouse button at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) Navigate ¶
func (r *ComputerService) Navigate(ctx context.Context, id string, body ComputerNavigateParams, opts ...option.RequestOption) (res *ActionResult, err error)
Navigate the browser to a specified URL. Optionally specify tab_id to navigate a specific tab (browser sessions only)
func (*ComputerService) New ¶
func (r *ComputerService) New(ctx context.Context, body ComputerNewParams, opts ...option.RequestOption) (res *ComputerResponse, err error)
Create a new automation session. Set kind to "browser" for web automation or "desktop" for OS-level automation. Defaults to "browser" if not specified. timeout_seconds controls max lifetime, inactivity_timeout_seconds controls idle timeout, and auto_kill disables only the idle timeout (max lifetime still applies).
func (*ComputerService) PressHotkey ¶
func (r *ComputerService) PressHotkey(ctx context.Context, id string, body ComputerPressHotkeyParams, opts ...option.RequestOption) (res *ActionResult, err error)
Press a combination of keys (e.g., ["Control", "c"] for copy). Optionally specify tab_id (browser sessions only)
func (*ComputerService) RightClick ¶
func (r *ComputerService) RightClick(ctx context.Context, id string, body ComputerRightClickParams, opts ...option.RequestOption) (res *ActionResult, err error)
Perform a right mouse click at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) ScrollViewport ¶
func (r *ComputerService) ScrollViewport(ctx context.Context, id string, body ComputerScrollViewportParams, opts ...option.RequestOption) (res *ActionResult, err error)
Scroll at the specified x,y position by delta dx,dy. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only)
func (*ComputerService) SetViewport ¶
func (r *ComputerService) SetViewport(ctx context.Context, id string, body ComputerSetViewportParams, opts ...option.RequestOption) (res *ActionResult, err error)
Change the browser viewport dimensions and scale factor. Optionally specify tab_id (browser sessions only)
func (*ComputerService) StreamEvents ¶
func (r *ComputerService) StreamEvents(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Stream real-time events using Server-Sent Events (SSE)
func (*ComputerService) StreamScreencast ¶
func (r *ComputerService) StreamScreencast(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Stream only screencast frames (base64 JPEG images) using Server-Sent Events (SSE) for live browser viewing
func (*ComputerService) Terminate ¶
func (r *ComputerService) Terminate(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Terminate and clean up a computer instance, stopping the session and recording metrics
func (*ComputerService) TypeText ¶
func (r *ComputerService) TypeText(ctx context.Context, id string, body ComputerTypeTextParams, opts ...option.RequestOption) (res *ActionResult, err error)
Type text into the currently focused element in the browser. Optionally specify tab_id (browser sessions only)
type ComputerSetViewportParams ¶
type ComputerSetViewportParams struct {
Height param.Opt[int64] `json:"height,omitzero"`
ScaleFactor param.Opt[float64] `json:"scale_factor,omitzero"`
TabID param.Opt[string] `json:"tab_id,omitzero"`
Width param.Opt[int64] `json:"width,omitzero"`
// contains filtered or unexported fields
}
func (ComputerSetViewportParams) MarshalJSON ¶
func (r ComputerSetViewportParams) MarshalJSON() (data []byte, err error)
func (*ComputerSetViewportParams) UnmarshalJSON ¶
func (r *ComputerSetViewportParams) UnmarshalJSON(data []byte) error
type ComputerTabDeleteParams ¶
type ComputerTabDeleteParams struct {
ID string `path:"id,required" json:"-"`
// contains filtered or unexported fields
}
type ComputerTabNewParams ¶
type ComputerTabNewParams struct {
URL param.Opt[string] `json:"url,omitzero"`
// contains filtered or unexported fields
}
func (ComputerTabNewParams) MarshalJSON ¶
func (r ComputerTabNewParams) MarshalJSON() (data []byte, err error)
func (*ComputerTabNewParams) UnmarshalJSON ¶
func (r *ComputerTabNewParams) UnmarshalJSON(data []byte) error
type ComputerTabService ¶
type ComputerTabService struct {
Options []option.RequestOption
}
ComputerTabService contains methods and other services that help with interacting with the computer API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputerTabService method instead.
func NewComputerTabService ¶
func NewComputerTabService(opts ...option.RequestOption) (r ComputerTabService)
NewComputerTabService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ComputerTabService) Delete ¶
func (r *ComputerTabService) Delete(ctx context.Context, tabID string, body ComputerTabDeleteParams, opts ...option.RequestOption) (res *ActionResult, err error)
Close a specific tab by ID. Cannot close the last remaining tab (browser sessions only). Tab IDs come from ListTabs.
func (*ComputerTabService) List ¶
func (r *ComputerTabService) List(ctx context.Context, id string, opts ...option.RequestOption) (res *ActionResult, err error)
Get a list of open tabs with IDs, URLs, titles, and main tab status (browser sessions only). Includes external CDP pages (e.g., Playwright). Excludes devtools:// and chrome:// tabs. Results may be eventually consistent for newly created tabs.
func (*ComputerTabService) New ¶
func (r *ComputerTabService) New(ctx context.Context, id string, body ComputerTabNewParams, opts ...option.RequestOption) (res *ActionResult, err error)
Create a new tab, optionally navigating to a URL. The new tab becomes the main tab (browser sessions only).
func (*ComputerTabService) Switch ¶
func (r *ComputerTabService) Switch(ctx context.Context, tabID string, body ComputerTabSwitchParams, opts ...option.RequestOption) (res *ActionResult, err error)
Switch the main/active tab to a different tab by ID (browser sessions only). Tab IDs come from ListTabs.
type ComputerTabSwitchParams ¶
type ComputerTabSwitchParams struct {
ID string `path:"id,required" json:"-"`
// contains filtered or unexported fields
}
type ComputerTypeTextParams ¶
type ComputerTypeTextParams struct {
TabID param.Opt[string] `json:"tab_id,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// contains filtered or unexported fields
}
func (ComputerTypeTextParams) MarshalJSON ¶
func (r ComputerTypeTextParams) MarshalJSON() (data []byte, err error)
func (*ComputerTypeTextParams) UnmarshalJSON ¶
func (r *ComputerTypeTextParams) UnmarshalJSON(data []byte) error
type V2GoBackendInternalTypesPageContext ¶
type V2GoBackendInternalTypesPageContext struct {
DeviceScaleFactor float64 `json:"device_scale_factor"`
IsMainTab bool `json:"is_main_tab"`
PageHeight int64 `json:"page_height"`
PageWidth int64 `json:"page_width"`
ScrollX float64 `json:"scroll_x"`
ScrollY float64 `json:"scroll_y"`
TabID string `json:"tab_id"`
Title string `json:"title"`
URL string `json:"url"`
ViewportHeight int64 `json:"viewport_height"`
ViewportWidth int64 `json:"viewport_width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeviceScaleFactor respjson.Field
IsMainTab respjson.Field
PageHeight respjson.Field
PageWidth respjson.Field
ScrollX respjson.Field
ScrollY respjson.Field
TabID respjson.Field
Title respjson.Field
URL respjson.Field
ViewportHeight respjson.Field
ViewportWidth respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (V2GoBackendInternalTypesPageContext) RawJSON ¶
func (r V2GoBackendInternalTypesPageContext) RawJSON() string
Returns the unmodified JSON received from the API
func (*V2GoBackendInternalTypesPageContext) UnmarshalJSON ¶
func (r *V2GoBackendInternalTypesPageContext) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|