bytestreamio

package
Version: v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package bytestreamio provides io interfaces on bytestream service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

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

Exists checks resource identified by resourceName exists in bytestream server.

Types

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.

Source Files

Jump to

Keyboard shortcuts

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