vendor/github.com/go-rod/rod/lib/proto/io.go

84 lines · 2270 bytes

 1// This file is generated by "./lib/proto/generate"
 2
 3package proto
 4
 5/*
 6
 7IO
 8
 9Input/Output operations for streams produced by DevTools.
10
11*/
12
13// IOStreamHandle This is either obtained from another method or specified as `blob:<uuid>` where
14// `<uuid>` is an UUID of a Blob.
15type IOStreamHandle string
16
17// IOClose Close the stream, discard any temporary backing storage.
18type IOClose struct {
19	// Handle of the stream to close.
20	Handle IOStreamHandle `json:"handle"`
21}
22
23// ProtoReq name.
24func (m IOClose) ProtoReq() string { return "IO.close" }
25
26// Call sends the request.
27func (m IOClose) Call(c Client) error {
28	return call(m.ProtoReq(), m, nil, c)
29}
30
31// IORead Read a chunk of the stream.
32type IORead struct {
33	// Handle of the stream to read.
34	Handle IOStreamHandle `json:"handle"`
35
36	// Offset (optional) Seek to the specified offset before reading (if not specified, proceed with offset
37	// following the last read). Some types of streams may only support sequential reads.
38	Offset *int `json:"offset,omitempty"`
39
40	// Size (optional) Maximum number of bytes to read (left upon the agent discretion if not specified).
41	Size *int `json:"size,omitempty"`
42}
43
44// ProtoReq name.
45func (m IORead) ProtoReq() string { return "IO.read" }
46
47// Call the request.
48func (m IORead) Call(c Client) (*IOReadResult, error) {
49	var res IOReadResult
50	return &res, call(m.ProtoReq(), m, &res, c)
51}
52
53// IOReadResult ...
54type IOReadResult struct {
55	// Base64Encoded (optional) Set if the data is base64-encoded
56	Base64Encoded bool `json:"base64Encoded,omitempty"`
57
58	// Data that were read.
59	Data string `json:"data"`
60
61	// EOF Set if the end-of-file condition occurred while reading.
62	EOF bool `json:"eof"`
63}
64
65// IOResolveBlob Return UUID of Blob object specified by a remote object id.
66type IOResolveBlob struct {
67	// ObjectID Object id of a Blob object wrapper.
68	ObjectID RuntimeRemoteObjectID `json:"objectId"`
69}
70
71// ProtoReq name.
72func (m IOResolveBlob) ProtoReq() string { return "IO.resolveBlob" }
73
74// Call the request.
75func (m IOResolveBlob) Call(c Client) (*IOResolveBlobResult, error) {
76	var res IOResolveBlobResult
77	return &res, call(m.ProtoReq(), m, &res, c)
78}
79
80// IOResolveBlobResult ...
81type IOResolveBlobResult struct {
82	// UUID of the specified Blob.
83	UUID string `json:"uuid"`
84}