io

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 3 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultiFileReaderAt

func NewMultiFileReaderAt(filePaths []string) (*multiFileReaderAt, error)

Create new multi file ReaderAt

Types

type Progress added in v0.4.0

type Progress interface {
	// Initializes a new progress indication for a new file transfer.
	// Input: 'total' - file size, 'prefix' - optional description, 'filePath' - path of the file being transferred (for description purposes only).
	// Output: progress indication id
	New(total int64, prefix, filePath string) (id int)
	// Replaces an indication (with the 'replaceId') when completed. Used when an additional work is done as part of the transfer.
	NewReplacement(replaceId int, prefix, filePath string) (id int)
	// Used to wrap an io.Reader in order to track the bytes reading count of the file transfer, and update indication 'id' accordingly.
	ReadWithProgress(id int, reader io.Reader) io.Reader
	// Aborts a progress indication. Called on both successful and unsuccessful operations
	Abort(id int)
	// Quits the whole progress mechanism
	Quit()
}

You may implement this interface to display progress indication of files transfer (upload / download)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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