cdproto: github.com/chromedp/cdproto/io Index | Files

package io

import "github.com/chromedp/cdproto/io"

Package io provides the Chrome DevTools Protocol commands, types, and events for the IO domain.

Input/Output operations for streams produced by DevTools.

Generated by the cdproto-gen command.

Index

Package Files

easyjson.go io.go types.go

Constants

const (
    CommandClose       = "IO.close"
    CommandRead        = "IO.read"
    CommandResolveBlob = "IO.resolveBlob"
)

Command names.

type CloseParams Uses

type CloseParams struct {
    Handle StreamHandle `json:"handle"` // Handle of the stream to close.
}

CloseParams close the stream, discard any temporary backing storage.

func Close Uses

func Close(handle StreamHandle) *CloseParams

Close close the stream, discard any temporary backing storage.

See: https://chromedevtools.github.io/devtools-protocol/tot/IO#method-close

parameters:

handle - Handle of the stream to close.

func (*CloseParams) Do Uses

func (p *CloseParams) Do(ctx context.Context) (err error)

Do executes IO.close against the provided context.

func (CloseParams) MarshalEasyJSON Uses

func (v CloseParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CloseParams) MarshalJSON Uses

func (v CloseParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CloseParams) UnmarshalEasyJSON Uses

func (v *CloseParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CloseParams) UnmarshalJSON Uses

func (v *CloseParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ReadParams Uses

type ReadParams struct {
    Handle StreamHandle `json:"handle"`           // Handle of the stream to read.
    Offset int64        `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   int64        `json:"size,omitempty"`   // Maximum number of bytes to read (left upon the agent discretion if not specified).
}

ReadParams read a chunk of the stream.

func Read Uses

func Read(handle StreamHandle) *ReadParams

Read read a chunk of the stream.

See: https://chromedevtools.github.io/devtools-protocol/tot/IO#method-read

parameters:

handle - Handle of the stream to read.

func (*ReadParams) Do Uses

func (p *ReadParams) Do(ctx context.Context) (data string, eof bool, err error)

Do executes IO.read against the provided context.

returns:

data - Data that were read.
eof - Set if the end-of-file condition occurred while reading.

func (ReadParams) MarshalEasyJSON Uses

func (v ReadParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ReadParams) MarshalJSON Uses

func (v ReadParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ReadParams) UnmarshalEasyJSON Uses

func (v *ReadParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ReadParams) UnmarshalJSON Uses

func (v *ReadParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (ReadParams) WithOffset Uses

func (p ReadParams) WithOffset(offset int64) *ReadParams

WithOffset 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 (ReadParams) WithSize Uses

func (p ReadParams) WithSize(size int64) *ReadParams

WithSize maximum number of bytes to read (left upon the agent discretion if not specified).

type ReadReturns Uses

type ReadReturns struct {
    Base64encoded bool   `json:"base64Encoded,omitempty"` // Set if the data is base64-encoded
    Data          string `json:"data,omitempty"`          // Data that were read.
    EOF           bool   `json:"eof,omitempty"`           // Set if the end-of-file condition occurred while reading.
}

ReadReturns return values.

func (ReadReturns) MarshalEasyJSON Uses

func (v ReadReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ReadReturns) MarshalJSON Uses

func (v ReadReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ReadReturns) UnmarshalEasyJSON Uses

func (v *ReadReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ReadReturns) UnmarshalJSON Uses

func (v *ReadReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ResolveBlobParams Uses

type ResolveBlobParams struct {
    ObjectID runtime.RemoteObjectID `json:"objectId"` // Object id of a Blob object wrapper.
}

ResolveBlobParams return UUID of Blob object specified by a remote object id.

func ResolveBlob Uses

func ResolveBlob(objectID runtime.RemoteObjectID) *ResolveBlobParams

ResolveBlob return UUID of Blob object specified by a remote object id.

See: https://chromedevtools.github.io/devtools-protocol/tot/IO#method-resolveBlob

parameters:

objectID - Object id of a Blob object wrapper.

func (*ResolveBlobParams) Do Uses

func (p *ResolveBlobParams) Do(ctx context.Context) (uuid string, err error)

Do executes IO.resolveBlob against the provided context.

returns:

uuid - UUID of the specified Blob.

func (ResolveBlobParams) MarshalEasyJSON Uses

func (v ResolveBlobParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ResolveBlobParams) MarshalJSON Uses

func (v ResolveBlobParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ResolveBlobParams) UnmarshalEasyJSON Uses

func (v *ResolveBlobParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ResolveBlobParams) UnmarshalJSON Uses

func (v *ResolveBlobParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ResolveBlobReturns Uses

type ResolveBlobReturns struct {
    UUID string `json:"uuid,omitempty"` // UUID of the specified Blob.
}

ResolveBlobReturns return values.

func (ResolveBlobReturns) MarshalEasyJSON Uses

func (v ResolveBlobReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ResolveBlobReturns) MarshalJSON Uses

func (v ResolveBlobReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ResolveBlobReturns) UnmarshalEasyJSON Uses

func (v *ResolveBlobReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ResolveBlobReturns) UnmarshalJSON Uses

func (v *ResolveBlobReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type StreamHandle Uses

type StreamHandle string

StreamHandle this is either obtained from another method or specified as blob:<uuid> where <uuid> is an UUID of a Blob.

See: https://chromedevtools.github.io/devtools-protocol/tot/IO#type-StreamHandle

func (StreamHandle) String Uses

func (t StreamHandle) String() string

String returns the StreamHandle as string value.

Package io imports 7 packages (graph) and is imported by 9 packages. Updated 2021-01-07. Refresh now. Tools for package owners.