#google-cloud #gc #ftp #libunftp #unftp #ftp-server

unftp-sbe-gcs

A storage back-end for libunftp, storing files in Google Cloud Storage (GCS)

8 releases

0.2.5 Dec 24, 2023
0.2.4 Sep 16, 2023
0.2.3 Jun 15, 2023
0.2.2 Jan 25, 2023
0.1.0 Mar 26, 2021

#991 in Network programming

Download history 83/week @ 2023-12-20 39/week @ 2023-12-27 1/week @ 2024-01-03 5/week @ 2024-01-17 2/week @ 2024-02-14 22/week @ 2024-02-21 59/week @ 2024-02-28 6/week @ 2024-03-06 24/week @ 2024-03-13 1/week @ 2024-03-20 8/week @ 2024-03-27 23/week @ 2024-04-03

57 downloads per month
Used in unftp

Apache-2.0

415KB
8K SLoC

unftp-sbe-gcs

Crate Version API Docs Crate License Follow on Telegram

An storage back-end for libunftp that let you store files in Google Cloud Storage. Please refer to the documentation and the examples directory for usage instructions.

Usage

Add the needed dependencies to Cargo.toml:

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

And add to src/main.rs:

 use libunftp::Server;
 use unftp_sbe_gcs::{ServerExt, options::AuthMethod};
 use std::path::PathBuf;

 #[tokio::main]
 pub async fn main() {
     let server = Server::with_gcs("my-bucket", PathBuf::from("/unftp"), AuthMethod::WorkloadIdentity(None))
       .greeting("Welcome to my FTP server")
       .passive_ports(50000..65535);

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

The above example uses the ServerExt extension trait. You can also call one of the other constructors of Server e.g.

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

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

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

For more usage information see the examples directory and the libunftp API documentation.

Getting help and staying informed

Support is given on a best effort basis. You are welcome to engage us on Github the discussions page or create a Github issue.

You can also follow news and talk to us on Telegram

License

You're free to use, modify and distribute this software under the terms of the Apache License v2.0.

Dependencies

~24–38MB
~681K SLoC