Crate objectstore_client

Crate objectstore_client 

Source
Expand description

§Objectstore Client

The client is used to interface with the objectstore backend. It handles responsibilities like transparent compression, and making sure that uploads and downloads are done as efficiently as possible.

§Usage

use objectstore_client::ClientBuilder;

#[tokio::main]
let client = ClientBuilder::new("http://localhost:8888/", "my-usecase")?
    .for_organization(42);

let id = client.put("hello world").send().await?;
let object = client.get(&id.key).send().await?.expect("object to exist");
assert_eq!(object.payload().await?, "hello world");

Structs§

Client
A scoped objectstore client that can access objects in a specific use case and scope.
ClientBuilder
Service for storing and retrieving objects.
GetBuilder
A GET request builder.
GetResult
The result from a successful get() call.
PutBuilder
A PUT request builder.
PutResponse
The response returned from the service after uploading an object.

Enums§

Compression
The compression algorithm of an object to upload.
Error
Errors that can happen within the objectstore-client
ExpirationPolicy
The per-object expiration policy

Constants§

PARAM_SCOPE
HTTP request query parameter that contains the request scope.
PARAM_USECASE
HTTP request query parameter that contains the request usecase.

Type Aliases§

ClientStream
The type of Stream to be used for a PUT request.
Result
A convenience alias that defaults our Error type.