Documentation ¶
Index ¶
- Constants
- Variables
- func AddAWSCredsFlags(cmd *cobra.Command)
- func AddAlertsFN(cmd *cobra.Command)
- func AddAllBackupListFlags(cmd *cobra.Command)
- func AddAllProviderFlags(cmd *cobra.Command)
- func AddAllStorageFlags(cmd *cobra.Command)
- func AddAzureCredsFlags(cmd *cobra.Command)
- func AddBackupIDFlag(cmd *cobra.Command, require bool)
- func AddCorsoPassphaseFlags(cmd *cobra.Command)
- func AddDataFlag(cmd *cobra.Command, allowed []string, hide bool)
- func AddDeltaPageSizeFlag(cmd *cobra.Command)
- func AddDisableDeltaFlag(cmd *cobra.Command)
- func AddDisableIncrementalsFlag(cmd *cobra.Command)
- func AddDisableLazyItemReader(cmd *cobra.Command)
- func AddDisableSlidingWindowLimiterFlag(cmd *cobra.Command)
- func AddEnableImmutableIDFlag(cmd *cobra.Command)
- func AddExchangeDetailsAndRestoreFlags(cmd *cobra.Command, emailOnly bool)
- func AddExportConfigFlags(cmd *cobra.Command)
- func AddFailFastFlag(cmd *cobra.Command)
- func AddFailedItemsFN(cmd *cobra.Command)
- func AddFetchParallelismFlag(cmd *cobra.Command)
- func AddFilesystemFlags(cmd *cobra.Command)
- func AddForceItemDataDownloadFlag(cmd *cobra.Command)
- func AddForceMaintenanceFlag(cmd *cobra.Command)
- func AddGenericBackupFlags(cmd *cobra.Command)
- func AddGlobalOperationFlags(cmd *cobra.Command)
- func AddGroupDetailsAndRestoreFlags(cmd *cobra.Command)
- func AddGroupFlag(cmd *cobra.Command)
- func AddMailBoxFlag(cmd *cobra.Command)
- func AddMaintenanceHostnameFlag(cmd *cobra.Command)
- func AddMaintenanceModeFlag(cmd *cobra.Command)
- func AddMaintenanceUserFlag(cmd *cobra.Command)
- func AddMultipleBackupIDsFlag(cmd *cobra.Command, require bool)
- func AddNoPermissionsFlag(cmd *cobra.Command)
- func AddOneDriveDetailsAndRestoreFlags(cmd *cobra.Command)
- func AddRecoveredErrorsFN(cmd *cobra.Command)
- func AddRestoreConfigFlags(cmd *cobra.Command, canRestoreToAlternate bool)
- func AddRetentionConfigFlags(cmd *cobra.Command)
- func AddRunModeFlag(cmd *cobra.Command, persistent bool)
- func AddS3BucketFlags(cmd *cobra.Command)
- func AddSharePointDetailsAndRestoreFlags(cmd *cobra.Command)
- func AddSiteFlag(cmd *cobra.Command, multiple bool)
- func AddSiteIDFlag(cmd *cobra.Command, multiple bool)
- func AddSkipReduceFlag(cmd *cobra.Command)
- func AddSkippedItemsFN(cmd *cobra.Command)
- func AddTeamDetailsAndRestoreFlags(cmd *cobra.Command)
- func AddTeamFlag(cmd *cobra.Command)
- func AddTeamsChatsDetailsAndRestoreFlags(cmd *cobra.Command)
- func AddUpdatePassphraseFlags(cmd *cobra.Command, require bool)
- func AddUserFlag(cmd *cobra.Command)
- func FilesystemFlagOverrides(cmd *cobra.Command) map[string]string
- func PopulateFilesystemFlags(flagset PopulatedFlags) map[string]string
- func PopulateS3Flags(flagset PopulatedFlags) map[string]string
- func S3FlagOverrides(cmd *cobra.Command) map[string]string
- type PopulatedFlags
Constants ¶
const ( ContactFN = "contact" ContactFolderFN = "contact-folder" ContactNameFN = "contact-name" EmailFN = "email" EmailFolderFN = "email-folder" EmailReceivedAfterFN = "email-received-after" EmailReceivedBeforeFN = "email-received-before" EmailSenderFN = "email-sender" EmailSubjectFN = "email-subject" EventFN = "event" EventCalendarFN = "event-calendar" EventOrganizerFN = "event-organizer" EventRecursFN = "event-recurs" EventStartsAfterFN = "event-starts-after" EventStartsBeforeFN = "event-starts-before" EventSubjectFN = "event-subject" )
const ( ArchiveFN = "archive" FormatFN = "format" )
const ( DataMessages = "messages" DataConversations = "conversations" )
const ( ChannelFN = "channel" ConversationFN = "conversation" GroupFN = "group" MessageFN = "message" PostFN = "post" MessageCreatedAfterFN = "message-created-after" MessageCreatedBeforeFN = "message-created-before" MessageLastReplyAfterFN = "message-last-reply-after" MessageLastReplyBeforeFN = "message-last-reply-before" )
const ( UserFN = "user" MailBoxFN = "mailbox" AzureClientTenantFN = "azure-tenant-id" AzureClientIDFN = "azure-client-id" AzureClientSecretFN = "azure-client-secret" )
const ( MaintenanceModeFN = "mode" ForceMaintenanceFN = "force" UserMaintenanceFN = "user" HostnameMaintenanceFN = "host" )
const ( FileFN = "file" FolderFN = "folder" FileCreatedAfterFN = "file-created-after" FileCreatedBeforeFN = "file-created-before" FileModifiedAfterFN = "file-modified-after" FileModifiedBeforeFN = "file-modified-before" UseOldDeltaProcessFN = "use-old-delta-process" )
const ( AlertsFN = "alerts" ConfigFileFN = "config-file" DeltaPageSizeFN = "delta-page-size" DisableDeltaFN = "disable-delta" DisableIncrementalsFN = "disable-incrementals" DisableLazyItemReaderFN = "disable-lazy-item-reader" DisableSlidingWindowLimiterFN = "disable-sliding-window-limiter" ForceItemDataDownloadFN = "force-item-data-download" EnableImmutableIDFN = "enable-immutable-id" FailFastFN = "fail-fast" FailedItemsFN = "failed-items" FetchParallelismFN = "fetch-parallelism" NoPermissionsFN = "no-permissions" NoStatsFN = "no-stats" RecoveredErrorsFN = "recovered-errors" RunModeFN = "run-mode" SkippedItemsFN = "skipped-items" SkipReduceFN = "skip-reduce" )
const ( RunModeFlagTest = "flag-test" RunModeRun = "run" )
well-known flag values
const ( BackupFN = "backup" BackupIDsFN = "backups" AWSAccessKeyFN = "aws-access-key" AWSSecretAccessKeyFN = "aws-secret-access-key" AWSSessionTokenFN = "aws-session-token" // Corso Flags PassphraseFN = "passphrase" NewPassphraseFN = "new-passphrase" )
const ( CollisionsFN = "collisions" DestinationFN = "destination" ToResourceFN = "to-resource" )
const ( RetentionModeFN = "retention-mode" RetentionDurationFN = "retention-duration" ExtendRetentionFN = "extend-retention" )
const ( BucketFN = "bucket" EndpointFN = "endpoint" PrefixFN = "prefix" DoNotUseTLSFN = "disable-tls" DoNotVerifyTLSFN = "disable-tls-verification" )
S3 bucket flags
const ( DataLibraries = "libraries" DataPages = "pages" DataLists = "lists" )
const ( LibraryFN = "library" ListFN = "list" ListModifiedAfterFN = "list-modified-after" ListModifiedBeforeFN = "list-modified-before" ListCreatedAfterFN = "list-created-after" ListCreatedBeforeFN = "list-created-before" PageFolderFN = "page-folder" PageFN = "page" SiteFN = "site" // site only accepts WebURL values SiteIDFN = "site-id" // site-id accepts actual site ids )
const CategoryDataFN = "data"
const (
DataChats = "chats"
)
const (
FilesystemPathFN = "path"
)
filesystem flag names
const Show = "show"
const (
TeamFN = "team"
)
const Wildcard = "*"
Variables ¶
var ( ContactFV []string ContactFolderFV []string ContactNameFV string EmailFV []string EmailFolderFV []string EmailReceivedAfterFV string EmailReceivedBeforeFV string EmailSenderFV string EmailSubjectFV string EventFV []string EventCalendarFV []string EventOrganizerFV string EventRecursFV string EventStartsAfterFV string EventStartsBeforeFV string EventSubjectFV string )
flag values (ie: FV)
var ( ArchiveFV bool FormatFV string )
var ( ChannelFV []string ConversationFV []string GroupFV []string MessageFV []string PostFV []string MessageCreatedAfterFV string MessageCreatedBeforeFV string MessageLastReplyAfterFV string MessageLastReplyBeforeFV string )
var ( UserFV []string AzureClientTenantFV string AzureClientIDFV string AzureClientSecretFV string )
var ( MaintenanceModeFV string ForceMaintenanceFV bool UserMaintenanceFV string HostnameMaintenanceFV string )
var ( FolderPathFV []string FileNameFV []string FileCreatedAfterFV string FileCreatedBeforeFV string FileModifiedAfterFV string FileModifiedBeforeFV string UseOldDeltaProcessFV bool )
var ( ConfigFileFV string DeltaPageSizeFV int DisableDeltaFV bool DisableIncrementalsFV bool DisableLazyItemReaderFV bool DisableSlidingWindowLimiterFV bool ForceItemDataDownloadFV bool EnableImmutableIDFV bool FailFastFV bool FailedItemsFV string FetchParallelismFV int ListAlertsFV string ListSkippedItemsFV string ListRecoveredErrorsFV string NoPermissionsFV bool NoStatsFV bool // RunMode describes the type of run, such as: // flagtest, dry, run. Should default to 'run'. RunModeFV string SkipReduceFV bool )
var ( BackupIDFV string BackupIDsFV []string AWSAccessKeyFV string AWSSecretAccessKeyFV string AWSSessionTokenFV string PassphraseFV string NewPhasephraseFV string )
var ( CollisionsFV string DestinationFV string ToResourceFV string )
var ( RetentionModeFV string RetentionDurationFV time.Duration ExtendRetentionFV bool )
var ( BucketFV string EndpointFV string PrefixFV string DoNotUseTLSFV bool DoNotVerifyTLSFV bool )
S3 bucket flag values
var ( LibraryFV string ListFV []string ListModifiedAfterFV string ListModifiedBeforeFV string ListCreatedAfterFV string ListCreatedBeforeFV string PageFolderFV []string PageFV []string SiteIDFV []string WebURLFV []string )
var CategoryDataFV []string
var (
FilesystemPathFV string
)
filesystem flag values
var TeamFV []string
Functions ¶
func AddAWSCredsFlags ¶
func AddAlertsFN ¶
func AddAllBackupListFlags ¶
func AddAllProviderFlags ¶
func AddAllStorageFlags ¶
func AddAzureCredsFlags ¶
AddAzureCredsFlags adds M365 cred flags
func AddBackupIDFlag ¶
AddBackupIDFlag adds the --backup flag.
func AddDeltaPageSizeFlag ¶
AddDeltaPageSizeFlag adds a hidden flag that allows callers to reduce delta query page sizes below 500.
func AddDisableDeltaFlag ¶
Adds the hidden '--disable-delta' cli flag which, when set, disables delta based backups.
func AddDisableIncrementalsFlag ¶
Adds the hidden '--disable-incrementals' cli flag which, when set, disables incremental backups.
func AddDisableLazyItemReader ¶
AddDisableLazyItemReader disables lazy item reader, such that we fall back to prefetch reader. This flag is currently only meant for groups conversations backup. Although it can be utilized for other services in future.
This flag should only be used if lazy item reader is the default choice and we want to fallback to prefetch reader.
func AddDisableSlidingWindowLimiterFlag ¶
AddDisableSlidingWindowLimiterFN disables the experimental sliding window rate limiter for graph API requests. This is only relevant for exchange backups. Exchange restores continue to use the default token bucket rate limiter. Setting this flag switches exchange backups to use the default token bucket rate limiter.
func AddEnableImmutableIDFlag ¶
Adds the hidden '--enable-immutable-id' cli flag which, when set, enables immutable IDs for Exchange
func AddExchangeDetailsAndRestoreFlags ¶
AddExchangeDetailsAndRestoreFlags adds flags that are common to both the details and restore commands.
func AddExportConfigFlags ¶
AddExportConfigFlags adds the restore config flag set.
func AddFailFastFlag ¶
AddFailFastFlag adds a flag to toggle fail-fast error handling behavior.
func AddFailedItemsFN ¶
func AddFetchParallelismFlag ¶
AddFetchParallelismFlag adds a hidden flag that allows callers to reduce call paralellism (ie, the corso worker pool size) from 4 to as low as 1.
func AddFilesystemFlags ¶
func AddForceItemDataDownloadFlag ¶
Adds the hidden '--force-item-data-download' cli flag which, when set, disables kopia-assisted incremental backups.
func AddForceMaintenanceFlag ¶
func AddGenericBackupFlags ¶
func AddGlobalOperationFlags ¶
AddGlobalOperationFlags adds the global operations flag set.
func AddGroupFlag ¶
AddGroupFlag adds the --group flag, which accepts either the id, the display name, or the mailbox address as its values. Users are expected to supply the display name. The ID is supported becase, well, IDs. The mailbox address is supported as a lookup fallback for certain SDK cases, therefore it's also supported here, though that support isn't exposed to end users.
func AddMailBoxFlag ¶
AddMailBoxFlag adds the --user and --mailbox flag.
func AddMaintenanceModeFlag ¶
func AddMaintenanceUserFlag ¶
func AddMultipleBackupIDsFlag ¶
AddMultipleBackupIDsFlag adds the --backups flag.
func AddNoPermissionsFlag ¶
AddNoPermissionsFlag adds OneDrive flag for skipping restoring permissions
func AddOneDriveDetailsAndRestoreFlags ¶
AddOneDriveDetailsAndRestoreFlags adds flags that are common to both the details and restore commands.
func AddRecoveredErrorsFN ¶
func AddRestoreConfigFlags ¶
AddRestoreConfigFlags adds the restore config flag set.
func AddRetentionConfigFlags ¶
AddRetentionConfigFlags adds the retention config flag set.
func AddRunModeFlag ¶
AddRunModeFlag adds the hidden --run-mode flag.
func AddSharePointDetailsAndRestoreFlags ¶
AddSharePointDetailsAndRestoreFlags adds flags that are common to both the details and restore commands.
func AddSiteFlag ¶
AddSiteFlag adds the --site flag, which accepts webURL values.
func AddSiteIDFlag ¶
AddSiteIDFlag adds the --site-id flag, which accepts site ID values. This flag is hidden, since we expect users to prefer the --site url and do not want to encourage confusion.
func AddSkipReduceFlag ¶
AddSkipReduceFlag adds a hidden flag that allows callers to skip the selector reduction step. Currently only intended for details commands, not restore.
func AddSkippedItemsFN ¶
func AddTeamFlag ¶
AddTeamFlag adds the --team flag, which accepts id or name values. TODO: need to decide what the appropriate "name" to accept here is. keepers thinks its either DisplayName or MailNickname or Mail Mail is most accurate, MailNickame is accurate and shorter, but the end user may not see either one visibly. https://learn.microsoft.com/en-us/graph/api/team-list?view=graph-rest-1.0&tabs=http
func AddUpdatePassphraseFlags ¶
M365 flags
func PopulateFilesystemFlags ¶
func PopulateFilesystemFlags(flagset PopulatedFlags) map[string]string
func PopulateS3Flags ¶
func PopulateS3Flags(flagset PopulatedFlags) map[string]string
Types ¶
type PopulatedFlags ¶
type PopulatedFlags map[string]struct{}
func GetPopulatedFlags ¶
func GetPopulatedFlags(cmd *cobra.Command) PopulatedFlags
GetPopulatedFlags returns a map of flags that have been populated by the user. Entry keys match the flag's long name. Values are empty.