io

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 9 Imported by: 21

Documentation

Overview

Package io implements the IO domain. Input/Output operations for streams produced by DevTools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the IO domain with the connection set to conn.

Types

type CloseArgs

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

CloseArgs represents the arguments for Close in the IO domain.

func NewCloseArgs

func NewCloseArgs(handle StreamHandle) *CloseArgs

NewCloseArgs initializes CloseArgs with the required arguments.

type ReadArgs

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).
}

ReadArgs represents the arguments for Read in the IO domain.

func NewReadArgs

func NewReadArgs(handle StreamHandle) *ReadArgs

NewReadArgs initializes ReadArgs with the required arguments.

func (*ReadArgs) SetOffset

func (a *ReadArgs) SetOffset(offset int) *ReadArgs

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 (*ReadArgs) SetSize

func (a *ReadArgs) SetSize(size int) *ReadArgs

SetSize sets the Size optional argument. Maximum number of bytes to read (left upon the agent discretion if not specified).

type ReadReply

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.
}

ReadReply represents the return values for Read in the IO domain.

type ResolveBlobArgs added in v0.9.1

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

ResolveBlobArgs represents the arguments for ResolveBlob in the IO domain.

func NewResolveBlobArgs added in v0.9.1

func NewResolveBlobArgs(objectID runtime.RemoteObjectID) *ResolveBlobArgs

NewResolveBlobArgs initializes ResolveBlobArgs with the required arguments.

type ResolveBlobReply added in v0.9.1

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

ResolveBlobReply represents the return values for ResolveBlob in the IO domain.

type StreamHandle

type StreamHandle string

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

type StreamReader added in v0.28.0

type StreamReader struct {
	// contains filtered or unexported fields
}

StreamReader represents a stream reader.

func NewStreamReader added in v0.28.0

func NewStreamReader(ctx context.Context, ioClient interface {
	Read(context.Context, *ReadArgs) (*ReadReply, error)
	Close(context.Context, *CloseArgs) error
}, handle StreamHandle) *StreamReader

NewStreamReader returns a reader for io.Streams that implements io.Reader from the standard library.

func (*StreamReader) Close added in v0.28.0

func (r *StreamReader) Close() error

Close the stream, discard any temporary backing storage.

func (*StreamReader) Read added in v0.28.0

func (r *StreamReader) Read(p []byte) (n int, err error)

Read a chunk of the stream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL