Documentation
¶
Index ¶
- Variables
- func GoogleDriveUnavailable() error
- 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 LoginResult
- 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 ErrNoLocalData = errors.New("no ccl configuration or OAuth credentials found to sync")
Functions ¶
func GoogleDriveUnavailable ¶ added in v1.7.0
func GoogleDriveUnavailable() error
GoogleDriveUnavailable explains why this build cannot log in to Google Drive (a development build has no OAuth client), or is nil when it can.
func HasActiveProfile ¶
func KeyModeDescription ¶
KeyModeDescription describes how this device unlocks the active profile.
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 LoginResult ¶
type LoginResult struct {
RemoteDir string
DeviceID string
Alias string
Provider string
Existing bool
KeyMode string
}
func LoginGoogleDriveNamed ¶
func LoginGoogleDriveNamed( ctx context.Context, alias string, notice interface{ Write([]byte) (int, error) }, ) (LoginResult, error)
LoginGoogleDriveNamed connects a Google account under a local alias. On a device without a profile it opens (or creates) the one stored in that account; otherwise it attaches the account to the active profile.
func LoginICloudNamed ¶
func LoginICloudNamed(alias 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 cloud remote. An empty alias selects the primary remote.
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
}