Documentation
¶
Index ¶
- Variables
- func HasActiveProfile() (bool, error)
- 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
- func WithPastedRedirect(ctx context.Context, in io.Reader) context.Context
- 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 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 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 KeyModeDescription ¶
func PrimaryRemoteAlias ¶
func RenameRemote ¶
func SetPrimaryRemote ¶
func SetRemoteMirror ¶
func WithPastedRedirect ¶ added in v1.5.24
WithPastedRedirect makes Google Drive login in ctx print the authorization URL instead of opening a browser, and read the address the browser was redirected to from in. Hosts without a browser (SSH, Cloud Shell) need this: Google's device flow rejects the drive.appdata scope, and the 127.0.0.1 redirect only reaches ccl from a browser on the same machine.
Types ¶
type Diagnostic ¶
type DiagnosticReport ¶
type DiagnosticReport struct {
Configured bool
ProfileID string
Remotes int
Checks []Diagnostic
}
func DiagnoseLocal ¶
func DiagnoseLocal() DiagnosticReport
DiagnoseLocal runs the local cloud-sync health checks in fixed order. Each diagnose* step appends to the report; steps may halt the pipeline by returning false when later checks would be meaningless.
type KeyExportResult ¶
func ExportRecoveryKey ¶
func ExportRecoveryKey() (KeyExportResult, error)
type KeyImportResult ¶
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 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 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
}