pub enum StorageNewSubCommand {
    Local {
        path: PathBuf,
        name: String,
    },
    Generic {
        name: String,
        init_command: String,
        list_command: String,
        download_command: String,
        upload_command: String,
        delete_command: String,
        max_processes: usize,
        url: Option<String>,
        storage_dir: Option<String>,
    },
    Rsync {
        name: String,
        host: String,
        port: Option<usize>,
        user: Option<String>,
        storage_dir: String,
    },
    S3 {
        name: String,
        storage_prefix: String,
        bucket_name: String,
        region: String,
    },
    Minio {
        name: String,
        endpoint: String,
        bucket_name: String,
        region: String,
        storage_prefix: String,
    },
    DigitalOcean {
        name: String,
        bucket_name: String,
        region: String,
        storage_prefix: String,
    },
    R2 {
        name: String,
        account_id: String,
        bucket_name: String,
        storage_prefix: String,
    },
    Gcs {
        name: String,
        bucket_name: String,
        region: String,
        storage_prefix: String,
    },
    Wasabi {
        name: String,
        bucket_name: String,
        endpoint: String,
        storage_prefix: String,
    },
}
Expand description

Add a new storage

Variants§

§

Local

Fields

§path: PathBuf

Directory (outside the repository) to be set as a storage

§name: String

Name of the storage.

Recommended to keep this name unique to refer easily.

Add a new local storage

A local storage is a directory accessible from the local file system. Xvc will use common file operations for this directory without accessing the network.

§

Generic

Fields

§name: String

Name of the storage.

Recommended to keep this name unique to refer easily.

§init_command: String

Command to initialize the storage. This command is run once after defining the storage.

You can use {URL} and {STORAGE_DIR} as shortcuts.

§list_command: String

Command to list the files in storage

You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§download_command: String

Command to download a file from storage.

You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§upload_command: String

Command to upload a file to storage.

You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§delete_command: String

The delete command to remove a file from storage You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§max_processes: usize

Number of maximum processes to run simultaneously

§url: Option<String>

You can set a string to replace {URL} placeholder in commands

§storage_dir: Option<String>

You can set a string to replace {STORAGE_DIR} placeholder in commands

Add a new generic storage.

⚠️ Please note that this is an advanced method to configure storages. You may damage your repository and local and remote files with incorrect configurations.

Please see https://docs.xvc.dev/ref/xvc-storage-new-generic.html for examples and make necessary backups before continuing.

§

Rsync

Fields

§name: String

Name of the storage.

Recommended to keep this name unique to refer easily.

§host: String

Hostname for the connection in the form host.example.com (without @, : or protocol)

§port: Option<usize>

Port number for the connection in the form 22. Doesn’t add port number to connection string if not given.

§user: Option<String>

User name for the connection, the part before @ in user@example.com (without @, hostname). User name isn’t included in connection strings if not given.

§storage_dir: String

storage directory in the host to store the files.

Add a new rsync storages

Uses rsync in separate processes to communicate. This can be used when you already have an SSH/Rsync connection.

§

S3

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§storage_prefix: String

You can set a directory in the bucket with this prefix

§bucket_name: String

S3 bucket name

§region: String

AWS region

Add a new S3 storage

§

Minio

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§endpoint: String

Minio server url in the form https://myserver.example.com:9090

§bucket_name: String

Bucket name

§region: String

Region of the server

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Minio storage

§

DigitalOcean

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§bucket_name: String

Bucket name

§region: String

Region of the server

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Digital Ocean storage

§

R2

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§account_id: String

R2 account ID

§bucket_name: String

Bucket name

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new R2 storage

§

Gcs

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§bucket_name: String

Bucket name

§region: String

Region of the server, e.g., europe-west3

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Google Cloud Storage storage

§

Wasabi

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§bucket_name: String

Bucket name

§endpoint: String

Endpoint for the server, complete with the region if there is

e.g. for eu-central-1 region, use s3.eu-central-1.wasabisys.com as the endpoint.

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Wasabi storage

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Assign values from ArgMatches to self.
Assign values from ArgMatches to self.
Append to Command so it can instantiate Self. Read more
Append to Command so it can update self. Read more
Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more