client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockSize = 512 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileClient

type FileClient interface {
	Open(filename string) (int64, error)

	Read(sessionId int64, buf []byte) (int, error)
	ReadAt(sessionId, offset, size int64) ([]byte, error)
	GetBlock(sessionId, blockId int64) ([]byte, error)

	Download(filename, saveFile string) error
	DownloadAt(filename, saveFile string, blockId int) error

	Create(filename string) (int64, error)

	Write(sessionID int64, buf []byte) (int, error)
	WriteAt(sessionId, offset int64, buf []byte) (int, error)
	SetBlock(sessionId, blockId int64, buf []byte) error

	Upload(filename, saveFile string) error
	UploadAt(filename, saveFile string, blockId int) error

	Stat(filename string) (*proto.StatResponse, error)

	Close(sessionId int64) error
}

FileClient is the client interface to access files

func NewClient

func NewClient(service string, c client.Client, fs *afero.Fs) FileClient

NewClient returns a new FileClient which uses a micro FileClient

Jump to

Keyboard shortcuts

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