| 1 |
package proton |
| 2 |
|
| 3 |
// Volume is a Proton Drive volume. |
| 4 |
type Volume struct { |
| 5 |
VolumeID string // Encrypted volume ID |
| 6 |
|
| 7 |
CreationTime int64 // Creation time of the volume in Unix time |
| 8 |
ModifyTime int64 // Last modification time of the volume in Unix time |
| 9 |
MaxSpace *int64 // Space limit for the volume in bytes, null if unlimited. |
| 10 |
UsedSpace int64 // Space used by files in the volume in bytes |
| 11 |
DownloadedBytes int64 // The amount of downloaded data since last reset |
| 12 |
UploadedBytes int64 // The amount of uploaded data since the last reset |
| 13 |
|
| 14 |
State VolumeState // The state of the volume (active, locked, maybe more in the future) |
| 15 |
Share VolumeShare // The main share of the volume |
| 16 |
RestoreStatus *VolumeRestoreStatus // The status of the restore task. Null if not applicable |
| 17 |
} |
| 18 |
|
| 19 |
// VolumeShare is the main share of a volume. |
| 20 |
type VolumeShare struct { |
| 21 |
ShareID string // Encrypted share ID |
| 22 |
LinkID string // Encrypted link ID |
| 23 |
} |
| 24 |
|
| 25 |
// VolumeState is the state of a volume. |
| 26 |
type VolumeState int |
| 27 |
|
| 28 |
const ( |
| 29 |
VolumeStateActive VolumeState = 1 |
| 30 |
VolumeStateLocked VolumeState = 3 |
| 31 |
) |
| 32 |
|
| 33 |
// VolumeRestoreStatus is the status of the restore task. |
| 34 |
type VolumeRestoreStatus int |
| 35 |
|
| 36 |
const ( |
| 37 |
RestoreStatusDone VolumeRestoreStatus = 0 |
| 38 |
RestoreStatusInProgress VolumeRestoreStatus = 1 |
| 39 |
RestoreStatusFailed VolumeRestoreStatus = -1 |
| 40 |
) |