MCPcopy Create free account
hub / github.com/openclaw/gogcli / getKeepService

Function getKeepService

internal/cmd/keep.go:419–445  ·  view source on GitHub ↗
(ctx context.Context, flags *RootFlags, keepCmd *KeepCmd)

Source from the content-addressed store, hash-verified

417}
418
419func getKeepService(ctx context.Context, flags *RootFlags, keepCmd *KeepCmd) (*keepapi.Service, error) {
420 if keepCmd.ServiceAccount != "" {
421 if keepCmd.Impersonate == "" {
422 return nil, fmt.Errorf("--impersonate is required when using --service-account")
423 }
424 return keepServiceWithServiceAccount(ctx, keepCmd.ServiceAccount, keepCmd.Impersonate)
425 }
426
427 account, err := requireAccount(flags)
428 if err != nil {
429 return nil, err
430 }
431
432 serviceAccounts, err := commandServiceAccountStore(ctx)
433 if err != nil {
434 return nil, err
435 }
436 file, exists, err := serviceAccounts.Existing(account, true)
437 if err != nil {
438 return nil, err
439 }
440 if exists {
441 return keepServiceWithServiceAccount(ctx, file.Path, account)
442 }
443
444 return nil, usage("Keep is Workspace-only and requires a service account. Configure it with: gog auth service-account set <email> --key <service-account.json> (or legacy: gog auth keep <email> --key <service-account.json>)")
445}

Callers 12

buildKeepBackupSnapshotFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls 6

requireAccountFunction · 0.85
usageFunction · 0.85
ErrorfMethod · 0.80
ExistingMethod · 0.80