This service can be used to:
root: Set the work directory for backendbucket: Set the container name for backendendpoint: Customizable endpoint settingaccess_key_id: Set the access_key_id for backend.secret_access_key: Set the secret_access_key for backend.You can refer to [CosBuilder]'s docs for more information
use opendal_core::Operator; use opendal_core::Result; use opendal_service_cos::Cos; #[tokio::main] async fn main() -> Result<()> { // create backend builder let mut builder = Cos::default() // set the storage bucket for OpenDAL .bucket("test") // set the endpoint for OpenDAL .endpoint("https://cos.ap-singapore.myqcloud.com") // Set the access_key_id and secret_access_key. // // OpenDAL will try load credential from the env. // If credential not set and no valid credential in env, OpenDAL will // send request without signing like anonymous user. .secret_id("secret_id") .secret_key("secret_access_key"); let op: Operator = Operator::new(builder)?.finish(); Ok(()) }