Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
58
native/desktop/maplefile/internal/domain/file/constants.go
Normal file
58
native/desktop/maplefile/internal/domain/file/constants.go
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package file
|
||||
|
||||
// SyncStatus defines the synchronization status of a file
|
||||
type SyncStatus int
|
||||
|
||||
const (
|
||||
// SyncStatusLocalOnly indicates the file exists only locally (not uploaded to cloud)
|
||||
SyncStatusLocalOnly SyncStatus = iota
|
||||
|
||||
// SyncStatusCloudOnly indicates the file exists only in the cloud (metadata synced, content not downloaded)
|
||||
SyncStatusCloudOnly
|
||||
|
||||
// SyncStatusSynced indicates the file exists both locally and in the cloud and is synchronized
|
||||
SyncStatusSynced
|
||||
|
||||
// SyncStatusModifiedLocally indicates the file exists in both places but has local changes pending upload
|
||||
SyncStatusModifiedLocally
|
||||
)
|
||||
|
||||
// String returns a human-readable string representation of the sync status
|
||||
func (s SyncStatus) String() string {
|
||||
switch s {
|
||||
case SyncStatusLocalOnly:
|
||||
return "local_only"
|
||||
case SyncStatusCloudOnly:
|
||||
return "cloud_only"
|
||||
case SyncStatusSynced:
|
||||
return "synced"
|
||||
case SyncStatusModifiedLocally:
|
||||
return "modified_locally"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
// Storage mode constants define which file versions to keep locally
|
||||
const (
|
||||
// StorageModeEncryptedOnly - Only keep encrypted version locally (most secure)
|
||||
StorageModeEncryptedOnly = "encrypted_only"
|
||||
|
||||
// StorageModeDecryptedOnly - Only keep decrypted version locally (not recommended)
|
||||
StorageModeDecryptedOnly = "decrypted_only"
|
||||
|
||||
// StorageModeHybrid - Keep both encrypted and decrypted versions (default, convenient)
|
||||
StorageModeHybrid = "hybrid"
|
||||
)
|
||||
|
||||
// File state constants
|
||||
const (
|
||||
// StatePending is the initial state of a file before it is uploaded
|
||||
StatePending = "pending"
|
||||
|
||||
// StateActive indicates that the file is fully uploaded and ready for use
|
||||
StateActive = "active"
|
||||
|
||||
// StateDeleted marks the file as deleted
|
||||
StateDeleted = "deleted"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue