| // Code generated by cdpgen. DO NOT EDIT. |
| |
| package io |
| |
| import ( |
| "github.com/mafredri/cdp/protocol/runtime" |
| ) |
| |
| // CloseArgs represents the arguments for Close in the IO domain. |
| type CloseArgs struct { |
| Handle StreamHandle `json:"handle"` // Handle of the stream to close. |
| } |
| |
| // NewCloseArgs initializes CloseArgs with the required arguments. |
| func NewCloseArgs(handle StreamHandle) *CloseArgs { |
| args := new(CloseArgs) |
| args.Handle = handle |
| return args |
| } |
| |
| // ReadArgs represents the arguments for Read in the IO domain. |
| type ReadArgs struct { |
| Handle StreamHandle `json:"handle"` // Handle of the stream to read. |
| Offset *int `json:"offset,omitempty"` // Seek to the specified offset before reading (if not specificed, proceed with offset following the last read). Some types of streams may only support sequential reads. |
| Size *int `json:"size,omitempty"` // Maximum number of bytes to read (left upon the agent discretion if not specified). |
| } |
| |
| // NewReadArgs initializes ReadArgs with the required arguments. |
| func NewReadArgs(handle StreamHandle) *ReadArgs { |
| args := new(ReadArgs) |
| args.Handle = handle |
| return args |
| } |
| |
| // SetOffset sets the Offset optional argument. Seek to the specified |
| // offset before reading (if not specificed, proceed with offset |
| // following the last read). Some types of streams may only support |
| // sequential reads. |
| func (a *ReadArgs) SetOffset(offset int) *ReadArgs { |
| a.Offset = &offset |
| return a |
| } |
| |
| // SetSize sets the Size optional argument. Maximum number of bytes to |
| // read (left upon the agent discretion if not specified). |
| func (a *ReadArgs) SetSize(size int) *ReadArgs { |
| a.Size = &size |
| return a |
| } |
| |
| // ReadReply represents the return values for Read in the IO domain. |
| type ReadReply struct { |
| Base64Encoded *bool `json:"base64Encoded,omitempty"` // Set if the data is base64-encoded |
| Data string `json:"data"` // Data that were read. |
| EOF bool `json:"eof"` // Set if the end-of-file condition occurred while reading. |
| } |
| |
| // ResolveBlobArgs represents the arguments for ResolveBlob in the IO domain. |
| type ResolveBlobArgs struct { |
| ObjectID runtime.RemoteObjectID `json:"objectId"` // Object id of a Blob object wrapper. |
| } |
| |
| // NewResolveBlobArgs initializes ResolveBlobArgs with the required arguments. |
| func NewResolveBlobArgs(objectID runtime.RemoteObjectID) *ResolveBlobArgs { |
| args := new(ResolveBlobArgs) |
| args.ObjectID = objectID |
| return args |
| } |
| |
| // ResolveBlobReply represents the return values for ResolveBlob in the IO domain. |
| type ResolveBlobReply struct { |
| UUID string `json:"uuid"` // UUID of the specified Blob. |
| } |