[−][src]Struct s3handler::Handler
The struct for generate the request
- host is a parameter for the server you want to link
- it can be s3.us-east-1.amazonaws.com or a ip, ex 10.1.1.100, for a ceph node
- auth_type specify the signature version of S3
- format specify the s3 response from server
- url_style specify the s3 request url style
- region is a paramter for the S3 cluster location
- if region is not specified, it will take default value us-east-1
- handle redirect It can be init from the config structure, for example:
let config = s3handler::CredentialConfig{ host: "s3.us-east-1.amazonaws.com".to_string(), access_key: "akey".to_string(), secret_key: "skey".to_string(), user: None, region: None, // default is us-east-1 s3_type: None, // default will try to config as AWS S3 handler secure: None, // dafault is false, because the integrity protect by HMAC }; let mut handler = s3handler::Handler::from(&config);
Fields
access_key: &'a str
secret_key: &'a str
host: &'a str
auth_type: AuthType
format: Format
url_style: UrlStyle
region: Option<String>
Implementations
impl<'_> Handler<'_>
[src]
pub fn la(&mut self) -> Result<Vec<S3Object>, Error>
[src]
List all objects in a bucket
pub fn ls(&mut self, prefix: Option<&str>) -> Result<Vec<S3Object>, Error>
[src]
List all bucket of an account or List all object of an bucket
pub fn put(&mut self, file: &str, dest: &str) -> Result<(), Error>
[src]
Upload a file to a S3 bucket
pub fn get(&mut self, src: &str, file: Option<&str>) -> Result<(), Error>
[src]
Download an object from S3 service
pub fn cat(&mut self, src: &str) -> Result<(String, Option<String>), Error>
[src]
Show the content and the content type of an object
pub fn del_with_flag(
&mut self,
src: &str,
headers: &mut Vec<(&str, &str)>
) -> Result<(), Error>
[src]
&mut self,
src: &str,
headers: &mut Vec<(&str, &str)>
) -> Result<(), Error>
Delete with header flags for some deletion features
- AWS - delete-marker
- Bigtera - secure-delete
pub fn del(&mut self, src: &str) -> Result<(), Error>
[src]
Delete an object
pub fn mb(&mut self, bucket: &str) -> Result<(), Error>
[src]
Make a new bucket
pub fn rb(&mut self, bucket: &str) -> Result<(), Error>
[src]
Remove a bucket
pub fn list_tag(&mut self, target: &str) -> Result<(), Error>
[src]
list all tags of an object
pub fn add_tag(
&mut self,
target: &str,
tags: &Vec<(&str, &str)>
) -> Result<(), Error>
[src]
&mut self,
target: &str,
tags: &Vec<(&str, &str)>
) -> Result<(), Error>
Put a tag on an object
pub fn del_tag(&mut self, target: &str) -> Result<(), Error>
[src]
Remove aa tag from an object
pub fn usage(
&mut self,
target: &str,
options: &Vec<(&str, &str)>
) -> Result<(), Error>
[src]
&mut self,
target: &str,
options: &Vec<(&str, &str)>
) -> Result<(), Error>
Show the usage of a bucket (CEPH only)
pub fn url_command(&mut self, url: &str) -> Result<(), Error>
[src]
Do a GET request for the specific URL This method is easily to show the configure of S3 not implemented
pub fn change_s3_type(&mut self, command: &str)
[src]
Change S3 type to aws/ceph
pub fn change_auth_type(&mut self, command: &str)
[src]
Change signature version to aws2/aws4 CEPH support aws2 and aws4 following AWS region support v2 signature before June 24, 2019
- US East (N. Virginia) Region
- US West (N. California) Region
- US West (Oregon) Region
- EU (Ireland) Region
- Asia Pacific (Tokyo) Region
- Asia Pacific (Singapore) Region
- Asia Pacific (Sydney) Region
- South America (So Paulo) Region
pub fn change_format_type(&mut self, command: &str)
[src]
Change response format to xml/json CEPH support json and xml AWS only support xml
pub fn change_url_style(&mut self, command: &str)
[src]
Change request url style
Trait Implementations
impl<'a> From<&'a CredentialConfig> for Handler<'a>
[src]
fn from(credential: &'a CredentialConfig) -> Self
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Handler<'a>
impl<'a> !Send for Handler<'a>
impl<'a> !Sync for Handler<'a>
impl<'a> Unpin for Handler<'a>
impl<'a> !UnwindSafe for Handler<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,