Documentation
¶
Index ¶
- Variables
- func DenyPairing(ctx context.Context, code, via string) error
- func HasActiveProfile() (bool, error)
- func HasDiagnosticErrors(report DiagnosticReport) bool
- func IsNotConfiguredDiagnostic(report DiagnosticReport) bool
- func KeyModeDescription(mode string) string
- func PrimaryRemoteAlias() (string, error)
- func RenameRemote(alias, newAlias string) error
- func SetPrimaryRemote(alias string) error
- func SetRemoteMirror(alias string, enabled bool) error
- type Diagnostic
- type DiagnosticReport
- type KeyExportResult
- type KeyImportResult
- type LoginResult
- func LoginGoogleDrive(ctx context.Context, usePassphrase bool, passphrase string, notice io.Writer) (LoginResult, error)
- func LoginGoogleDriveNamed(ctx context.Context, alias string, usePassphrase bool, passphrase string, ...) (LoginResult, error)
- func LoginICloud(passphrase string) (LoginResult, error)
- func LoginICloudKeychain() (LoginResult, error)
- func LoginICloudLocalKey() (LoginResult, error)
- func LoginICloudNamed(alias string, usePassphrase bool, passphrase string) (LoginResult, error)
- func LoginICloudWithPassphrase(passphrase string) (LoginResult, error)
- type LogoutOptions
- type LogoutResult
- type Manager
- type PairingApproveResult
- type PairingCompleteResult
- type PairingRequestInfo
- type PairingRequestResult
- type PartialPushError
- type PullResult
- type PushResult
- type RemoteInfo
- type RemotePushOutcome
- type Status
- type TagResult
Constants ¶
This section is empty.
Variables ¶
var ( ErrKeychainItemMissing = errors.New("sync key is not present in macOS Keychain") )
var ErrNoLocalData = errors.New("no ccl configuration or OAuth credentials found to sync")
Functions ¶
func HasActiveProfile ¶
func HasDiagnosticErrors ¶
func HasDiagnosticErrors(report DiagnosticReport) bool
func IsNotConfiguredDiagnostic ¶
func IsNotConfiguredDiagnostic(report DiagnosticReport) bool
func KeyModeDescription ¶
func PrimaryRemoteAlias ¶
func RenameRemote ¶
func SetPrimaryRemote ¶
func SetRemoteMirror ¶
Types ¶
type Diagnostic ¶
type DiagnosticReport ¶
type DiagnosticReport struct {
Configured bool
ProfileID string
Remotes int
Checks []Diagnostic
}
func DiagnoseLocal ¶
func DiagnoseLocal() DiagnosticReport
type KeyExportResult ¶
func ExportRecoveryKey ¶
func ExportRecoveryKey() (KeyExportResult, error)
type KeyImportResult ¶
func ImportRecoveryKey ¶
func ImportRecoveryKey(value string) (KeyImportResult, error)
func ImportRecoveryKeyForProvider ¶
func ImportRecoveryKeyForProvider(value, requestedProvider string) (KeyImportResult, error)
ImportRecoveryKeyForProvider restores a profile after its cloud provider has been authorized. An empty provider uses the active cloud configuration, then falls back to a saved Google authorization and finally iCloud.
type LoginResult ¶
type LoginResult struct {
RemoteDir string
DeviceID string
Alias string
Provider string
Existing bool
KeyMode string
Migrated bool
}
func LoginGoogleDrive ¶
func LoginGoogleDrive( ctx context.Context, usePassphrase bool, passphrase string, notice io.Writer, ) (LoginResult, error)
LoginGoogleDrive starts the native browser OAuth flow, downloads the application-private sync bundle, then opens or creates its encrypted profile. The OAuth client identity is built into ccl; callers never supply a JSON file.
func LoginGoogleDriveNamed ¶
func LoginGoogleDriveNamed( ctx context.Context, alias string, usePassphrase bool, passphrase string, notice interface{ Write([]byte) (int, error) }, ) (LoginResult, error)
LoginGoogleDriveNamed connects a Google account under a local alias. The first login reuses the v1 implementation and immediately migrates it to v2; later logins attach an independent OAuth token/cache to the active profile.
func LoginICloud ¶
func LoginICloud(passphrase string) (LoginResult, error)
LoginICloud retains the original passphrase API for callers that explicitly select the legacy-compatible passphrase mode.
func LoginICloudKeychain ¶
func LoginICloudKeychain() (LoginResult, error)
func LoginICloudLocalKey ¶
func LoginICloudLocalKey() (LoginResult, error)
LoginICloudLocalKey is the default macOS mode. It uses a random 256-bit master key stored under ~/.ccl/cloud/profiles/<id>/key (with a temporary ~/.ccl/cloud.key only until the v2 registry is created), and migrates the short-lived Keychain mode used by earlier ccl builds.
func LoginICloudNamed ¶
func LoginICloudNamed(alias string, usePassphrase bool, passphrase string) (LoginResult, error)
func LoginICloudWithPassphrase ¶
func LoginICloudWithPassphrase(passphrase string) (LoginResult, error)
type LogoutOptions ¶
type LogoutResult ¶
type LogoutResult struct {
Alias string
Provider string
NewPrimary string
RemoteDeleted bool
TokenRevoked bool
LocalOnly bool
}
func LogoutRemote ¶
func LogoutRemote(ctx context.Context, alias string, options LogoutOptions) (LogoutResult, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func LoadRemote ¶
LoadRemote loads a selected v2 cloud remote. An empty alias selects the primary remote. A legacy v1 configuration is migrated locally before use.
type PairingApproveResult ¶
type PairingApproveResult struct {
Code string
RequestID string
DeviceID string
DeviceName string
ExpiresAt time.Time
}
func ApprovePairing ¶
func ApprovePairing( ctx context.Context, code, via string, ) (PairingApproveResult, error)
type PairingCompleteResult ¶
func CompletePairing ¶
func CompletePairing( ctx context.Context, code string, ) (PairingCompleteResult, error)
type PairingRequestInfo ¶
type PairingRequestInfo struct {
Code string
RequestID string
Alias string
DeviceID string
DeviceName string
CreatedAt time.Time
ExpiresAt time.Time
}
func ListPairingRequests ¶
type PairingRequestResult ¶
func PendingPairingRequests ¶
func PendingPairingRequests() ([]PairingRequestResult, error)
func StartPairing ¶
func StartPairing( ctx context.Context, via, deviceName string, ) (PairingRequestResult, error)
type PartialPushError ¶
type PartialPushError struct {
Message string
}
func (*PartialPushError) Error ¶
func (err *PartialPushError) Error() string
func (*PartialPushError) ExitCode ¶
func (*PartialPushError) ExitCode() int
type PullResult ¶
type RemoteInfo ¶
type RemoteInfo struct {
ID string
Alias string
Provider string
ProfileID string
Primary bool
Mirror bool
Enabled bool
SignedIn bool
RemoteLabel string
AccountHint string
}
func ListRemotes ¶
func ListRemotes() ([]RemoteInfo, error)
ListRemotes returns the locally configured cloud remotes in stable order. It does not contact any provider.
type RemotePushOutcome ¶
type RemotePushOutcome struct {
Alias string
Result PushResult
Err error
}
func PushRemotes ¶
func PushRemotes(to string, all, force, bestEffort bool) ([]RemotePushOutcome, error)
PushRemotes pushes one prepared encrypted snapshot to one or more remotes. All targets are preflighted before the first write unless bestEffort is set.
type Status ¶
type Status struct {
Alias string
Primary bool
Mirror bool
Provider string
KeyMode string
RemoteDir string
DeviceID string
LocalHash string
PendingTag string
RemoteTag string
RemoteID string
RemoteHash string
RemoteDeviceID string
RemoteCreated time.Time
LastOperation string
LastSyncAt time.Time
State string
}