Documentation
¶
Overview ¶
Package folder keeps backups in a folder of this computer, most often one that a sync client (iCloud Drive, OneDrive, Dropbox, Nextcloud, Syncthing…) carries to the user's other devices. A backup is done once it is written here; the sync client uploads it afterwards.
Index ¶
- Constants
- Variables
- type Folder
- func (f *Folder) Check(ctx context.Context) error
- func (f *Folder) Delete(ctx context.Context, name string) error
- func (f *Folder) Get(ctx context.Context, name string) ([]byte, error)
- func (f *Folder) List(ctx context.Context) ([]backup.Object, error)
- func (f *Folder) Put(ctx context.Context, name string, data []byte) error
- type Place
Constants ¶
const ICloudDrive = "iCloud"
ICloudDrive is the name Known gives iCloud Drive.
Variables ¶
var ( // ErrPath reports a folder that is not given by its full path. ErrPath = errors.New("folder: not a full path") // ErrDenied reports a folder this process may not read or write. ErrDenied = errors.New("folder: permission denied") )
Functions ¶
This section is empty.
Types ¶
type Folder ¶
type Folder struct {
// Dir is the folder's full path; it is made when missing, as long as
// its parent is there.
Dir string
}
Folder is a folder of this computer that keeps backups.
func (*Folder) Delete ¶
Delete removes the backup name, or its placeholder, which has iCloud Drive delete it.
func (*Folder) Get ¶
Get reads the backup name, first asking iCloud Drive to download it when only its placeholder is here.
type Place ¶
type Place struct {
// Name is the sync client's, which is not translated.
Name string
// Path is the folder's full path.
Path string
}
Place is a sync client's folder found on this computer.