pub fn new(config: S3Cfg) -> Self {
        let region = match config.backend {
            S3Backend::Minio => {
                Region::Custom { name:     "minio_s3".to_owned(),
                                 endpoint: config.endpoint.to_string(), }
            }
            S3Backend::Aws => Region::from_str(config.endpoint.as_str()).unwrap(),
        };
        let aws_id = config.key_id;
        let aws_secret = config.secret_key;
        let cred_provider = StaticProvider::new_minimal(aws_id, aws_secret);
        let client = S3Client::new(RequestDispatcher::default(), cred_provider, region);
        let bucket = config.bucket_name;

        S3Handler { client, bucket }
    }
// The S3 Handler struct contains all of the credential
// and target information that we should need to perfom
// any backend operations
The S3 Handler struct contains all of the credential
and target information that we should need to perfom
any backend operations
The S3 Handler struct contains all of the credential and target information that we should need to perfom any backend operations
pub fn new(config: S3Cfg) -> Self {
        let region = match config.backend {
            S3Backend::Minio => {
                Region::Custom { name:     "minio_s3".to_owned(),
                                 endpoint: config.endpoint.to_string(), }
            }
            S3Backend::Aws => Region::from_str(config.endpoint.as_str()).unwrap(),
        };
        let aws_id = config.key_id;
        let aws_secret = config.secret_key;
        let cred_provider = StaticProvider::new_minimal(aws_id, aws_secret);
        let client = S3Client::new(RequestDispatcher::default(), cred_provider, region);
        let bucket = config.bucket_name;
        S3Handler { client, bucket }
    }
pub fn new ( config : S3Cfg ) -> Self { let region = match config . backend { S3Backend :: Minio => { Region :: Custom { name : " " . to_owned ( ) , endpoint : config . endpoint . to_string ( ) , } } S3Backend :: Aws => Region :: from_str ( config . endpoint . as_str ( ) ) . unwrap ( ) , } ; let aws_id = config . key_id ; let aws_secret = config . secret_key ; let cred_provider = StaticProvider :: new_minimal ( aws_id , aws_secret ) ; let client = S3Client :: new ( RequestDispatcher :: default ( ) , cred_provider , region ) ; let bucket = config . bucket_name ; S3Handler { client , bucket } }
The S3 Handler struct contains all of the credential
and target information that we should need to perfom
any backend operations
The S3 Handler struct contains all of the credential and target information that we should need to perfom any backend operations
config
S3Cfg
config
S3Cfg