Skip to main content

Crate unftp_sbe_gcs

Crate unftp_sbe_gcs 

Source
Expand description

An storage back-end for libunftp that let you store files in Google Cloud Storage.

§Usage

Add the needed dependencies to Cargo.toml:

[dependencies]
libunftp = "0.23.0"
unftp-sbe-gcs = "0.3.0"
tokio = { version = "1", features = ["full"] }

And add to src/main.rs:

use libunftp::ServerBuilder;
use unftp_sbe_gcs::{CloudStorage, options::AuthMethod};
use std::path::PathBuf;

#[tokio::main]
pub async fn main() {
    let server = ServerBuilder::new(
        Box::new(move || CloudStorage::with_bucket_root("my-bucket", PathBuf::from("/unftp"), AuthMethod::WorkloadIdentity(None)))
      )
      .greeting("Welcome to my FTP server")
      .passive_ports(50000..=65535)
      .build()
      .unwrap();

    server.listen("127.0.0.1:2121").await;
}

Modules§

object_metadata
The Metadata for the CloudStorage
options
Contains code pertaining to initialization options for the Cloud Storage Backend

Structs§

CloudStorage
A StorageBackend that uses Cloud storage from Google. cloned for each controlchan!