Documentation ¶
Index ¶
- Variables
- func HasReadAccess(ctx context.Context, stg Storage) error
- func IsInitialized(ctx context.Context, stg Storage) (bool, error)
- func PrettySize(size int64) string
- func Upload(ctx context.Context, src Source, dst Storage, ...) (int64, error)
- type Canceller
- type FileInfo
- type Source
- type Storage
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExist is an error for file doesn't exists on storage ErrNotExist = errors.New("no such file") ErrEmpty = errors.New("file is empty") ErrUninitialized = errors.New("uninitialized") )
View Source
var ErrCancelled = errors.New("backup canceled")
ErrCancelled means backup was canceled
Functions ¶
func HasReadAccess ¶
HasReadAccess checks if the provided storage allows the reading of file content.
It gets the size (stat) and reads the content of the PBM init file.
ErrUninitialized is returned if there is no init file.
func IsInitialized ¶
IsInitialized checks if there is PBM init file on the storage.
func PrettySize ¶
Types ¶
type Storage ¶
type Storage interface { Type() Type Save(name string, data io.Reader, size int64) error SourceReader(name string) (io.ReadCloser, error) // FileStat returns file info. It returns error if file is empty or not exists. FileStat(name string) (FileInfo, error) // List scans path with prefix and returns all files with given suffix. // Both prefix and suffix can be omitted. List(prefix, suffix string) ([]FileInfo, error) // Delete deletes given file. // It returns storage.ErrNotExist if a file doesn't exists. Delete(name string) error // Copy makes a copy of the src objec/file under dst name Copy(src, dst string) error }
Click to show internal directories.
Click to hide internal directories.