erickguan commented on issue #5702:
URL: https://github.com/apache/opendal/issues/5702#issuecomment-2763701110

   @uruemu Great to hear—and thanks for your interest! This task should be 
fairly straightforward, requiring only a bit of familiarity with OpenDAL and 
some basic Rust concepts.
   
   If you’d like to start exploring the code early, here’s what the work 
involves:
   
   - Create a new module `core/src/services/ftp/core.rs` with a struct 
`FtpCore`. Here's a rough example:
   
     ```rust
     // It’s up to you to decide what belongs in `FtpCore`.
     struct FtpCore {
         endpoint: String,
         user: String,
         password: String,
         enable_secure: bool,
         pool: OnceCell<bb8::Pool<Manager>>,
     }
     ```
   
   - Keep `FtpBuilder` and `FtpConfig` in `backend.rs`. Inside 
`Builder::build`, you’ll construct the `FtpCore`.
   - Use an `Arc<FtpCore>` to share state across structs like `FtpBackend` and 
`FtpReader`.
   - OpenDAL requires the FTP service to implement the `Access` trait. The 
logic for this should go into `core.rs`, as it's considered internal 
implementation detail.
   - For example, functions like `ftp_connect` and `ftp_stat` can be moved to 
`core.rs`.
   - As you go, you’ll iterate on what should live in `core.rs` versus what 
stays in `backend.rs`.
   - Use the helper method `parse_error` in `ftp/err.rs` to handle error 
propagation.
   - Refer to other services (e.g., `sftp`, `fs`) to see how helper functions 
and logic are structured.
   - To test FTP behavior with OpenDAL, run:
   
     ```sh
     OPENDAL_TEST=ftp cargo test behavior::test \
       --features tests,services-ftp \
       -- \
       --show-output
     ```
   
     You’ll need to set the following environment variables:
   
     - `OPENDAL_FTP_ENDPOINT=ftp://<endpoint>`
     - `OPENDAL_FTP_ROOT=/path/to/dir`
     - `OPENDAL_FTP_USER=<user>`
     - `OPENDAL_FTP_PASSWORD=<password>`
   
     You can run an FTP server locally, for example, using a Docker container.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@opendal.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to