flags

package
v0.0.0-...-64de1d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	ArchiveFN = "archive"
	FormatFN  = "format"
)
View Source
const (
	DataMessages      = "messages"
	DataConversations = "conversations"
)
View Source
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"
)
View Source
const (
	UserFN              = "user"
	MailBoxFN           = "mailbox"
	AzureClientTenantFN = "azure-tenant-id"
	AzureClientIDFN     = "azure-client-id"
	AzureClientSecretFN = "azure-client-secret"
)
View Source
const (
	MaintenanceModeFN     = "mode"
	ForceMaintenanceFN    = "force"
	UserMaintenanceFN     = "user"
	HostnameMaintenanceFN = "host"
)
View Source
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"
)
View Source
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"
)
View Source
const (
	RunModeFlagTest = "flag-test"
	RunModeRun      = "run"
)

well-known flag values

View Source
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"
)
View Source
const (
	CollisionsFN  = "collisions"
	DestinationFN = "destination"
	ToResourceFN  = "to-resource"
)
View Source
const (
	RetentionModeFN     = "retention-mode"
	RetentionDurationFN = "retention-duration"
	ExtendRetentionFN   = "extend-retention"
)
View Source
const (
	BucketFN         = "bucket"
	EndpointFN       = "endpoint"
	PrefixFN         = "prefix"
	DoNotUseTLSFN    = "disable-tls"
	DoNotVerifyTLSFN = "disable-tls-verification"
)

S3 bucket flags

View Source
const (
	DataLibraries = "libraries"
	DataPages     = "pages"
	DataLists     = "lists"
)
View Source
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
)
View Source
const CategoryDataFN = "data"
View Source
const (
	DataChats = "chats"
)
View Source
const (
	FilesystemPathFN = "path"
)

filesystem flag names

View Source
const Show = "show"
View Source
const (
	TeamFN = "team"
)
View Source
const Wildcard = "*"

Variables

View Source
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)

View Source
var (
	ArchiveFV bool
	FormatFV  string
)
View Source
var (
	ChannelFV      []string
	ConversationFV []string
	GroupFV        []string
	MessageFV      []string
	PostFV         []string

	MessageCreatedAfterFV    string
	MessageCreatedBeforeFV   string
	MessageLastReplyAfterFV  string
	MessageLastReplyBeforeFV string
)
View Source
var (
	UserFV              []string
	AzureClientTenantFV string
	AzureClientIDFV     string
	AzureClientSecretFV string
)
View Source
var (
	MaintenanceModeFV     string
	ForceMaintenanceFV    bool
	UserMaintenanceFV     string
	HostnameMaintenanceFV string
)
View Source
var (
	FolderPathFV []string
	FileNameFV   []string

	FileCreatedAfterFV   string
	FileCreatedBeforeFV  string
	FileModifiedAfterFV  string
	FileModifiedBeforeFV string

	UseOldDeltaProcessFV bool
)
View Source
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
)
View Source
var (
	BackupIDFV           string
	BackupIDsFV          []string
	AWSAccessKeyFV       string
	AWSSecretAccessKeyFV string
	AWSSessionTokenFV    string
	PassphraseFV         string
	NewPhasephraseFV     string
)
View Source
var (
	CollisionsFV  string
	DestinationFV string
	ToResourceFV  string
)
View Source
var (
	RetentionModeFV     string
	RetentionDurationFV time.Duration
	ExtendRetentionFV   bool
)
View Source
var (
	BucketFV         string
	EndpointFV       string
	PrefixFV         string
	DoNotUseTLSFV    bool
	DoNotVerifyTLSFV bool
)

S3 bucket flag values

View Source
var (
	LibraryFV string

	ListFV               []string
	ListModifiedAfterFV  string
	ListModifiedBeforeFV string
	ListCreatedAfterFV   string
	ListCreatedBeforeFV  string

	PageFolderFV []string
	PageFV       []string

	SiteIDFV []string
	WebURLFV []string
)
View Source
var CategoryDataFV []string
View Source
var (
	FilesystemPathFV string
)

filesystem flag values

View Source
var TeamFV []string

Functions

func AddAWSCredsFlags

func AddAWSCredsFlags(cmd *cobra.Command)

func AddAlertsFN

func AddAlertsFN(cmd *cobra.Command)

func AddAllBackupListFlags

func AddAllBackupListFlags(cmd *cobra.Command)

func AddAllProviderFlags

func AddAllProviderFlags(cmd *cobra.Command)

func AddAllStorageFlags

func AddAllStorageFlags(cmd *cobra.Command)

func AddAzureCredsFlags

func AddAzureCredsFlags(cmd *cobra.Command)

AddAzureCredsFlags adds M365 cred flags

func AddBackupIDFlag

func AddBackupIDFlag(cmd *cobra.Command, require bool)

AddBackupIDFlag adds the --backup flag.

func AddCorsoPassphaseFlags

func AddCorsoPassphaseFlags(cmd *cobra.Command)

M365 flags

func AddDataFlag

func AddDataFlag(cmd *cobra.Command, allowed []string, hide bool)

func AddDeltaPageSizeFlag

func AddDeltaPageSizeFlag(cmd *cobra.Command)

AddDeltaPageSizeFlag adds a hidden flag that allows callers to reduce delta query page sizes below 500.

func AddDisableDeltaFlag

func AddDisableDeltaFlag(cmd *cobra.Command)

Adds the hidden '--disable-delta' cli flag which, when set, disables delta based backups.

func AddDisableIncrementalsFlag

func AddDisableIncrementalsFlag(cmd *cobra.Command)

Adds the hidden '--disable-incrementals' cli flag which, when set, disables incremental backups.

func AddDisableLazyItemReader

func AddDisableLazyItemReader(cmd *cobra.Command)

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

func AddDisableSlidingWindowLimiterFlag(cmd *cobra.Command)

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

func AddEnableImmutableIDFlag(cmd *cobra.Command)

Adds the hidden '--enable-immutable-id' cli flag which, when set, enables immutable IDs for Exchange

func AddExchangeDetailsAndRestoreFlags

func AddExchangeDetailsAndRestoreFlags(cmd *cobra.Command, emailOnly bool)

AddExchangeDetailsAndRestoreFlags adds flags that are common to both the details and restore commands.

func AddExportConfigFlags

func AddExportConfigFlags(cmd *cobra.Command)

AddExportConfigFlags adds the restore config flag set.

func AddFailFastFlag

func AddFailFastFlag(cmd *cobra.Command)

AddFailFastFlag adds a flag to toggle fail-fast error handling behavior.

func AddFailedItemsFN

func AddFailedItemsFN(cmd *cobra.Command)

func AddFetchParallelismFlag

func AddFetchParallelismFlag(cmd *cobra.Command)

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 AddFilesystemFlags(cmd *cobra.Command)

func AddForceItemDataDownloadFlag

func AddForceItemDataDownloadFlag(cmd *cobra.Command)

Adds the hidden '--force-item-data-download' cli flag which, when set, disables kopia-assisted incremental backups.

func AddForceMaintenanceFlag

func AddForceMaintenanceFlag(cmd *cobra.Command)

func AddGenericBackupFlags

func AddGenericBackupFlags(cmd *cobra.Command)

func AddGlobalOperationFlags

func AddGlobalOperationFlags(cmd *cobra.Command)

AddGlobalOperationFlags adds the global operations flag set.

func AddGroupDetailsAndRestoreFlags

func AddGroupDetailsAndRestoreFlags(cmd *cobra.Command)

func AddGroupFlag

func AddGroupFlag(cmd *cobra.Command)

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

func AddMailBoxFlag(cmd *cobra.Command)

AddMailBoxFlag adds the --user and --mailbox flag.

func AddMaintenanceHostnameFlag

func AddMaintenanceHostnameFlag(cmd *cobra.Command)

func AddMaintenanceModeFlag

func AddMaintenanceModeFlag(cmd *cobra.Command)

func AddMaintenanceUserFlag

func AddMaintenanceUserFlag(cmd *cobra.Command)

func AddMultipleBackupIDsFlag

func AddMultipleBackupIDsFlag(cmd *cobra.Command, require bool)

AddMultipleBackupIDsFlag adds the --backups flag.

func AddNoPermissionsFlag

func AddNoPermissionsFlag(cmd *cobra.Command)

AddNoPermissionsFlag adds OneDrive flag for skipping restoring permissions

func AddOneDriveDetailsAndRestoreFlags

func AddOneDriveDetailsAndRestoreFlags(cmd *cobra.Command)

AddOneDriveDetailsAndRestoreFlags adds flags that are common to both the details and restore commands.

func AddRecoveredErrorsFN

func AddRecoveredErrorsFN(cmd *cobra.Command)

func AddRestoreConfigFlags

func AddRestoreConfigFlags(cmd *cobra.Command, canRestoreToAlternate bool)

AddRestoreConfigFlags adds the restore config flag set.

func AddRetentionConfigFlags

func AddRetentionConfigFlags(cmd *cobra.Command)

AddRetentionConfigFlags adds the retention config flag set.

func AddRunModeFlag

func AddRunModeFlag(cmd *cobra.Command, persistent bool)

AddRunModeFlag adds the hidden --run-mode flag.

func AddS3BucketFlags

func AddS3BucketFlags(cmd *cobra.Command)

S3 bucket flags

func AddSharePointDetailsAndRestoreFlags

func AddSharePointDetailsAndRestoreFlags(cmd *cobra.Command)

AddSharePointDetailsAndRestoreFlags adds flags that are common to both the details and restore commands.

func AddSiteFlag

func AddSiteFlag(cmd *cobra.Command, multiple bool)

AddSiteFlag adds the --site flag, which accepts webURL values.

func AddSiteIDFlag

func AddSiteIDFlag(cmd *cobra.Command, multiple bool)

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

func AddSkipReduceFlag(cmd *cobra.Command)

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 AddSkippedItemsFN(cmd *cobra.Command)

func AddTeamDetailsAndRestoreFlags

func AddTeamDetailsAndRestoreFlags(cmd *cobra.Command)

func AddTeamFlag

func AddTeamFlag(cmd *cobra.Command)

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 AddTeamsChatsDetailsAndRestoreFlags

func AddTeamsChatsDetailsAndRestoreFlags(cmd *cobra.Command)

func AddUpdatePassphraseFlags

func AddUpdatePassphraseFlags(cmd *cobra.Command, require bool)

M365 flags

func AddUserFlag

func AddUserFlag(cmd *cobra.Command)

AddUserFlag adds the --user flag.

func FilesystemFlagOverrides

func FilesystemFlagOverrides(cmd *cobra.Command) map[string]string

func PopulateFilesystemFlags

func PopulateFilesystemFlags(flagset PopulatedFlags) map[string]string

func PopulateS3Flags

func PopulateS3Flags(flagset PopulatedFlags) map[string]string

func S3FlagOverrides

func S3FlagOverrides(cmd *cobra.Command) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL