Documentation ¶
Overview ¶
Package cli implements command-line commands for the Kopia.
Index ¶
- Constants
- func CheckIndexInfo(i0, i1 content.Info) []string
- type App
- func (c *App) AddStorageProvider(p StorageProvider)
- func (c *App) Attach(app *kingpin.Application)
- func (c *App) EnvName(n string) string
- func (c *App) RegisterOnExit(f func())
- func (c *App) RunSubcommand(ctx context.Context, kpapp *kingpin.Application, stdin io.Reader, ...) (stdout, stderr io.Reader, wait func() error, interrupt func(os.Signal))
- func (c *App) SetEnvNamePrefixForTesting(prefix string)
- func (c *App) SetLoggerFactory(loggerForModule logging.LoggerFactory)
- func (c *App) SetRestoreProgress(p RestoreProgress)
- func (c *App) Stderr() io.Writer
- type MaintenanceInfo
- type RepositoryStatus
- type RestoreProgress
- type SnapshotManifest
- type StorageFlags
- type StorageProvider
- type StorageProviderServices
Constants ¶
const DirMode = 0o700
DirMode is the directory mode for output directories.
Variables ¶
This section is empty.
Functions ¶
func CheckIndexInfo ¶ added in v0.13.0
CheckIndexInfo compare two index infos. If a mismatch exists, return an error with diagnostic information.
Types ¶
type App ¶
type App struct { AdvancedCommands string // contains filtered or unexported fields }
App contains per-invocation flags and state of Kopia CLI.
func (*App) AddStorageProvider ¶ added in v0.10.4
func (c *App) AddStorageProvider(p StorageProvider)
AddStorageProvider adds a new StorageProvider at runtime after the App has been initialized with the default providers. This is used in tests which require custom storage providers to simulate various edge cases.
func (*App) Attach ¶ added in v0.9.0
func (c *App) Attach(app *kingpin.Application)
Attach attaches the CLI parser to the application.
func (*App) EnvName ¶ added in v0.11.3
EnvName overrides the provided environment variable name for testability.
func (*App) RegisterOnExit ¶ added in v0.9.7
func (c *App) RegisterOnExit(f func())
RegisterOnExit registers the provided function to run before app exits.
func (*App) RunSubcommand ¶ added in v0.9.0
func (c *App) RunSubcommand(ctx context.Context, kpapp *kingpin.Application, stdin io.Reader, argsAndFlags []string) (stdout, stderr io.Reader, wait func() error, interrupt func(os.Signal))
RunSubcommand executes the subcommand asynchronously in current process with flags in an isolated CLI environment and returns standard output and standard error.
func (*App) SetEnvNamePrefixForTesting ¶ added in v0.11.3
SetEnvNamePrefixForTesting sets the name prefix to be used for all environment variable names for testing.
func (*App) SetLoggerFactory ¶ added in v0.9.1
func (c *App) SetLoggerFactory(loggerForModule logging.LoggerFactory)
SetLoggerFactory sets the logger factory to be used throughout the app.
func (*App) SetRestoreProgress ¶ added in v0.18.0
func (c *App) SetRestoreProgress(p RestoreProgress)
SetRestoreProgress is used to set custom restore progress, purposed to be used in tests.
type MaintenanceInfo ¶ added in v0.9.0
type MaintenanceInfo struct { maintenance.Params maintenance.Schedule `json:"schedule"` }
MaintenanceInfo is used to display the maintenance info in JSON format.
type RepositoryStatus ¶ added in v0.10.7
type RepositoryStatus struct { ConfigFile string `json:"configFile"` UniqueIDHex string `json:"uniqueIDHex"` ClientOptions repo.ClientOptions `json:"clientOptions"` Storage blob.ConnectionInfo `json:"storage"` Capacity *blob.Capacity `json:"volume,omitempty"` ContentFormat format.ContentFormat `json:"contentFormat"` ObjectFormat format.ObjectFormat `json:"objectFormat"` BlobRetention format.BlobStorageConfiguration `json:"blobRetention"` }
RepositoryStatus is used to display the repository info in JSON format.
type RestoreProgress ¶ added in v0.18.0
RestoreProgress is invoked to report progress during a restore.
type SnapshotManifest ¶ added in v0.11.0
type SnapshotManifest struct { *snapshot.Manifest RetentionReasons []string `json:"retentionReason,omitempty"` }
SnapshotManifest defines the JSON output for the CLI snapshot commands.
type StorageFlags ¶ added in v0.10.4
type StorageFlags interface { Setup(sps StorageProviderServices, cmd *kingpin.CmdClause) Connect(ctx context.Context, isCreate bool, formatVersion int) (blob.Storage, error) }
StorageFlags is implemented by cli storage providers which need to support a particular backend. This requires the common setup and connection methods implemented by all the cli storage providers.
type StorageProvider ¶ added in v0.10.4
type StorageProvider struct { Name string Description string NewFlags func() StorageFlags }
StorageProvider is a CLI provider for storage options and allows the CLI to multiplex between various provider CLI flag constructors.
type StorageProviderServices ¶ added in v0.10.4
type StorageProviderServices interface { EnvName(s string) string // contains filtered or unexported methods }
StorageProviderServices is implemented by the cli App that allows the cli and tests to mutate the default storage providers.
Source Files ¶
- app.go
- auto_upgrade.go
- cli_progress.go
- command_acl.go
- command_acl_add.go
- command_acl_delete.go
- command_acl_enable.go
- command_acl_list.go
- command_benchmark.go
- command_benchmark_compression.go
- command_benchmark_crypto.go
- command_benchmark_ecc.go
- command_benchmark_encryption.go
- command_benchmark_hashing.go
- command_benchmark_splitters.go
- command_blob.go
- command_blob_delete.go
- command_blob_gc.go
- command_blob_list.go
- command_blob_shards.go
- command_blob_shards_modify.go
- command_blob_show.go
- command_blob_stats.go
- command_cache.go
- command_cache_clear.go
- command_cache_info.go
- command_cache_prefetch.go
- command_cache_set.go
- command_cache_sync.go
- command_content.go
- command_content_delete.go
- command_content_list.go
- command_content_range_flags.go
- command_content_rewrite.go
- command_content_show.go
- command_content_stats.go
- command_content_verify.go
- command_diff.go
- command_index.go
- command_index_epoch.go
- command_index_epoch_list.go
- command_index_inspect.go
- command_index_list.go
- command_index_optimize.go
- command_index_recover.go
- command_logs.go
- command_logs_cleanup.go
- command_logs_list.go
- command_logs_session.go
- command_logs_show.go
- command_ls.go
- command_maintenance.go
- command_maintenance_info.go
- command_maintenance_run.go
- command_maintenance_set.go
- command_manifest.go
- command_manifest_delete.go
- command_manifest_ls.go
- command_manifest_show.go
- command_mount.go
- command_notification.go
- command_notification_configure_common.go
- command_notification_configure_email.go
- command_notification_configure_pushover.go
- command_notification_configure_testsender.go
- command_notification_configure_webhook.go
- command_notification_profile.go
- command_notification_profile_configure.go
- command_notification_profile_delete.go
- command_notification_profile_list.go
- command_notification_profile_send.go
- command_notification_template.go
- command_notification_template_list.go
- command_notification_template_remove.go
- command_notification_template_set.go
- command_notification_template_show.go
- command_policy.go
- command_policy_edit.go
- command_policy_export.go
- command_policy_import.go
- command_policy_ls.go
- command_policy_remove.go
- command_policy_set.go
- command_policy_set_actions.go
- command_policy_set_compression.go
- command_policy_set_error_handling.go
- command_policy_set_files.go
- command_policy_set_logging.go
- command_policy_set_os_snapshot.go
- command_policy_set_retention.go
- command_policy_set_scheduling.go
- command_policy_set_splitter.go
- command_policy_set_upload.go
- command_policy_show.go
- command_repository.go
- command_repository_change_password.go
- command_repository_connect.go
- command_repository_connect_from_config.go
- command_repository_connect_server.go
- command_repository_create.go
- command_repository_disconnect.go
- command_repository_repair.go
- command_repository_set_client.go
- command_repository_set_parameters.go
- command_repository_status.go
- command_repository_sync.go
- command_repository_throttle.go
- command_repository_throttle_get.go
- command_repository_throttle_set.go
- command_repository_upgrade.go
- command_repository_validate_provider.go
- command_restore.go
- command_server.go
- command_server_cancel.go
- command_server_flush.go
- command_server_pause.go
- command_server_refresh.go
- command_server_resume.go
- command_server_shutdown.go
- command_server_snapshot.go
- command_server_source_manager_action.go
- command_server_start.go
- command_server_status.go
- command_server_throttle.go
- command_server_throttle_get.go
- command_server_throttle_set.go
- command_server_tls.go
- command_session.go
- command_session_list.go
- command_show.go
- command_snapshot.go
- command_snapshot_copy_move_history.go
- command_snapshot_create.go
- command_snapshot_delete.go
- command_snapshot_estimate.go
- command_snapshot_expire.go
- command_snapshot_fix.go
- command_snapshot_fix_invalid_files.go
- command_snapshot_fix_remove_files.go
- command_snapshot_list.go
- command_snapshot_migrate.go
- command_snapshot_pin.go
- command_snapshot_restore.go
- command_snapshot_verify.go
- command_user.go
- command_user_add_set.go
- command_user_delete.go
- command_user_hash_password.go
- command_user_info.go
- command_user_list.go
- config.go
- error_notifications.go
- inproc.go
- json_output.go
- observability_flags.go
- password.go
- password_linux.go
- profile.go
- restore_progress.go
- show_utils.go
- sighup_unix.go
- storage_azure.go
- storage_b2.go
- storage_filesystem.go
- storage_gcs.go
- storage_gdrive.go
- storage_providers.go
- storage_rclone.go
- storage_s3.go
- storage_sftp.go
- storage_webdav.go
- throttle_get.go
- throttle_set.go
- update_check.go