server: go.chromium.org/goma/server/bytestreamio Index | Files

package bytestreamio

import "go.chromium.org/goma/server/bytestreamio"

Package bytestreamio provides io interfaces on bytestream service.

Index

Package Files

bytestreamio.go

func Exists Uses

func Exists(ctx context.Context, c pb.ByteStreamClient, resourceName string) error

Exists checks resource identified by resourceName exists in bytestream server.

type Reader Uses

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

Reader is a reader on bytestream.

func Open Uses

func Open(ctx context.Context, c pb.ByteStreamClient, resourceName string) (*Reader, error)

Open opens reader on bytestream for resourceName. ctx will be used until Reader is closed.

func (*Reader) Read Uses

func (r *Reader) Read(buf []byte) (int, error)

Read reads data from bytestream. The maximum data chunk size would be determined by server side.

func (*Reader) Size Uses

func (r *Reader) Size() int64

Size reports read size by Read.

type Writer Uses

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

Writer is a writer on bytestream.

func Create Uses

func Create(ctx context.Context, c pb.ByteStreamClient, resourceName string) (*Writer, error)

Create creates writer on bytestream for resourceName. ctx will be used until Writer is closed.

func (*Writer) Close Uses

func (w *Writer) Close() error

Close cloes the writer.

func (*Writer) Write Uses

func (w *Writer) Write(buf []byte) (int, error)

Write writes data to bytestream. The maximum data chunk size would be determined by server side, so don't pass larger chunk than maximum data chunk size.

Package bytestreamio imports 5 packages (graph) and is imported by 2 packages. Updated 2019-05-20. Refresh now. Tools for package owners.