bootstrapper

package
v2.4.0-pre Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStreamer

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

FileStreamer handles reading and writing of a file using a stream of chunks.

func NewFileStreamer

func NewFileStreamer(fs afero.Fs) *FileStreamer

NewFileStreamer creates a new FileStreamer.

func (*FileStreamer) ReadStream

func (f *FileStreamer) ReadStream(filename string, stream WriteChunkStream, chunksize uint, showProgress bool) error

ReadStream opens a file to read from and streams its contents chunkwise over gRPC.

func (*FileStreamer) WriteStream

func (f *FileStreamer) WriteStream(filename string, stream ReadChunkStream, showProgress bool) error

WriteStream opens a file to write to and streams chunks from a gRPC stream into the file.

type ReadChunkStream

type ReadChunkStream interface {
	Recv() (*pb.Chunk, error)
}

ReadChunkStream is abstraction over a gRPC stream that allows us to receive chunks via gRPC.

type WriteChunkStream

type WriteChunkStream interface {
	Send(chunk *pb.Chunk) error
}

WriteChunkStream is abstraction over a gRPC stream that allows us to send chunks via gRPC.

Jump to

Keyboard shortcuts

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