Module backblaze_b2::raw [] [src]

This module contains five different modules, each with different functions for accessing the b2 api directly.

The various methods for accessing the backblaze api are implemented on an Authorization struct. There are 3 different authorization structs: B2Authorization, UploadAuthorization and DownloadAuthorization.

All access to the library starts with somehow obtaining the appropriate authorization struct. In order to obtain an B2Authorization, one must first obtain a B2Credentials, which contains a b2 user id and api key. Using this struct an authorization token can be obtained in the form of the B2Authorization struct:

extern crate hyper;
extern crate hyper_native_tls;
use hyper::Client;
use hyper::net::HttpsConnector;
use hyper_native_tls::NativeTlsClient;
use backblaze_b2::raw::authorize::B2Credentials;

let ssl = NativeTlsClient::new().unwrap();
let connector = HttpsConnector::new(ssl);
let client = Client::with_connector(connector);

let cred = B2Credentials {
    id: "user id".to_owned(), key: "user key".to_owned()
};
let auth = cred.authorize(&client).unwrap();

This B2Authorization struct can be used to perform various requests to the b2 api, see the documentation on the B2Authorization for documentation regarding each of the possible functions.

Modules

authorize

This module defines various methods and structs used for authenticating on the B2 server.

buckets

This module defines various methods for interacting with buckets on backblaze.

download

This module defines various methods and structs for interacting with downloads on backblaze.

files

This module defines various methods for interacting with the files on backblaze. There are also various structs for storing information about files on backblaze.

upload

This module defines various methods and structs for interacting with uplaods on backblaze.