Back to godoc.org

Package bytestreamio

v0.0.15
Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module: go.chromium.org/goma/server

Overview

Package bytestreamio provides io interfaces on bytestream service.

Index

func Exists

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

Exists checks resource identified by resourceName exists in bytestream server.

type Reader

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

Reader is a reader on bytestream.

func Open

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

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

func (r *Reader) Size() int64

Size reports read size by Read.

type Writer

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

Writer is a writer on bytestream.

func Create

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

func (w *Writer) Close() error

Close cloes the writer.

func (*Writer) Write

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 Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier