protofile

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedProtoReader

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

BufferedProtoReader reads the chunks written by BufferedProtoWriter. Callers should call ReadProto until it returns io.EOF, at which point the stream has been exhausted. N.B. This *DOES NOT* guarantee that a caller has read all data for a streamID, because it may still be written to from another goroutine.

func NewBufferedProtoReader

func NewBufferedProtoReader(bs interfaces.Blobstore, streamID string) *BufferedProtoReader

func (*BufferedProtoReader) ReadProto

func (w *BufferedProtoReader) ReadProto(ctx context.Context, msg proto.Message) error

type BufferedProtoWriter

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

BufferedProtoWriter chunks together and writes protos to blobstore after a chunk exceeds maxBufferSizeBytes size. The caller is responsible for calling Flush to ensure all data is written.

func NewBufferedProtoWriter

func NewBufferedProtoWriter(bs interfaces.Blobstore, streamID string, bufferSizeBytes int) *BufferedProtoWriter

func (*BufferedProtoWriter) Flush

func (w *BufferedProtoWriter) Flush(ctx context.Context) error

func (*BufferedProtoWriter) TimeSinceLastWrite

func (w *BufferedProtoWriter) TimeSinceLastWrite() time.Duration

func (*BufferedProtoWriter) WriteProtoToStream

func (w *BufferedProtoWriter) WriteProtoToStream(ctx context.Context, msg proto.Message) error

Jump to

Keyboard shortcuts

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