Documentation
¶
Index ¶
Constants ¶
View Source
const (
BlockSize = 512 * 1024
)
Variables ¶
View Source
var (
ErrFileClosed = errors.New("File is closed")
)
Functions ¶
This section is empty.
Types ¶
type File ¶ added in v0.4.0
type File interface {
io.Closer
io.Reader
io.ReaderAt
io.Seeker
io.Writer
io.WriterAt
Readdir(count int) ([]os.FileInfo, error)
Readdirnames(n int) ([]string, error)
Stat() (os.FileInfo, error)
Sync() error
Truncate(size int64) error
WriteString(s string) (ret int, err error)
os.FileInfo
WithContext(ctx context.Context) File
}
type FileClient ¶
type FileClient interface {
Open(filename string) (File, 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
WithContext(ctx context.Context) FileClient
}
FileClient is the client interface to access files
Click to show internal directories.
Click to hide internal directories.