File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,3 +191,9 @@ cargo run --release -p stresstest -- -c stresstest/config/example.yaml
191191Similar to the objectstore server, you can find example configuration files in
192192the ` config ` subfolder. Copy and save your own files there, as they will not be
193193tracked by git.
194+
195+ ## License
196+
197+ Like Sentry, Objectstore is licensed under the FSL. See the ` LICENSE.md ` file
198+ and [ this blog post] ( https://blog.sentry.io/introducing-the-functional-source-license-freedom-without-free-riding/ )
199+ for more information.
Original file line number Diff line number Diff line change 11[package ]
22name = " objectstore-client"
3+ authors = [" Sentry <oss@sentry.io>" ]
4+ description = " Client SDK for Objectstore, the Sentry object storage platform"
5+ homepage = " https://getsentry.github.io/objectstore/"
6+ repository = " https://github.com/getsentry/objectstore"
7+ license-file = " ../LICENSE.md"
38version = " 0.1.0"
49edition = " 2024"
10+ rust-version = " 1.89"
11+ publish = true
512
613[dependencies ]
714anyhow = { workspace = true }
Original file line number Diff line number Diff line change 1+ # Objectstore Client
2+
3+ The client is used to interface with the objectstore backend. It handles
4+ responsibilities like transparent compression, and making sure that uploads and
5+ downloads are done as efficiently as possible.
6+
7+ ## Usage
8+
9+ ``` rust
10+ use objectstore_client :: ClientBuilder ;
11+
12+ let client = ClientBuilder :: new (" http://localhost:8888/" , " my-usecase" )?
13+ . for_organization (42 );
14+
15+ let id = client . put (" hello world" ). send (). await ? ;
16+ let object = client . get (& id . key). send (). await ? . expect (" object to exist" );
17+ assert_eq! (object . payload (). await ? , " hello world" );
18+ ```
19+
20+ ## License
21+
22+ Like Sentry, Objectstore is licensed under the FSL. See the ` LICENSE.md ` file
23+ and [ this blog post] ( https://blog.sentry.io/introducing-the-functional-source-license-freedom-without-free-riding/ )
24+ for more information.
Original file line number Diff line number Diff line change 11use std:: { fmt, io} ;
22
33use async_compression:: tokio:: bufread:: ZstdDecoder ;
4+ use bytes:: BytesMut ;
45use futures_util:: { StreamExt , TryStreamExt } ;
56use objectstore_types:: Metadata ;
67use reqwest:: StatusCode ;
@@ -19,6 +20,21 @@ pub struct GetResult {
1920 /// The response stream.
2021 pub stream : ClientStream ,
2122}
23+
24+ impl GetResult {
25+ /// Loads the object payload fully into memory.
26+ pub async fn payload ( self ) -> anyhow:: Result < bytes:: Bytes > {
27+ let bytes: BytesMut = self . stream . try_collect ( ) . await ?;
28+ Ok ( bytes. freeze ( ) )
29+ }
30+
31+ /// Loads the object payload fully into memory and interprets it as UTF-8 text.
32+ pub async fn text ( self ) -> anyhow:: Result < String > {
33+ let bytes = self . payload ( ) . await ?;
34+ Ok ( String :: from_utf8 ( bytes. to_vec ( ) ) ?)
35+ }
36+ }
37+
2238impl fmt:: Debug for GetResult {
2339 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
2440 f. debug_struct ( "GetResult" )
Original file line number Diff line number Diff line change 1- //! The Storage Client
1+ //! # Objectstore Client
22//!
3- //! The Client is used to interface with the objectstore backend.
4- //! It handles responsibilities like transparent compression, and making sure that
5- //! uploads and downloads are done as efficiently as possible.
3+ //! The client is used to interface with the objectstore backend. It handles responsibilities like
4+ //! transparent compression, and making sure that uploads and downloads are done as efficiently as
5+ //! possible.
6+ //!
7+ //! ## Usage
8+ //!
9+ //! ```no_run
10+ //! use objectstore_client::ClientBuilder;
11+ //!
12+ //! #[tokio::main]
13+ //! # async fn main() -> anyhow::Result<()> {
14+ //! let client = ClientBuilder::new("http://localhost:8888/", "my-usecase")?
15+ //! .for_organization(42);
16+ //!
17+ //! let id = client.put("hello world").send().await?;
18+ //! let object = client.get(&id.key).send().await?.expect("object to exist");
19+ //! assert_eq!(object.payload().await?, "hello world");
20+ //! # Ok(())
21+ //! # }
22+ //! ```
623#![ warn( missing_docs) ]
724#![ warn( missing_debug_implementations) ]
825
Original file line number Diff line number Diff line change 11[package ]
22name = " objectstore-server"
3+ authors = [" Sentry <oss@sentry.io>" ]
4+ description = " Web server application of Objectstore, the Sentry object storage platform"
5+ homepage = " https://getsentry.github.io/objectstore/"
6+ repository = " https://github.com/getsentry/objectstore"
7+ license-file = " ../LICENSE.md"
38version = " 0.1.0"
49edition = " 2024"
510build = " build.rs"
11+ publish = false
612
713[dependencies ]
814anyhow = { workspace = true }
Original file line number Diff line number Diff line change 11[package ]
22name = " objectstore-service"
3+ authors = [" Sentry <oss@sentry.io>" ]
4+ description = " Storage and backend logic of Objectstore, the Sentry object storage platform"
5+ homepage = " https://getsentry.github.io/objectstore/"
6+ repository = " https://github.com/getsentry/objectstore"
7+ license-file = " ../LICENSE.md"
38version = " 0.1.0"
49edition = " 2024"
10+ publish = false
511
612[dependencies ]
713anyhow = { workspace = true }
Original file line number Diff line number Diff line change 11[package ]
22name = " objectstore-types"
3+ authors = [" Sentry <oss@sentry.io>" ]
4+ description = " Shared types for the Objectstore client and server"
5+ homepage = " https://getsentry.github.io/objectstore/"
6+ repository = " https://github.com/getsentry/objectstore"
7+ license-file = " ../LICENSE.md"
38version = " 0.1.0"
49edition = " 2024"
10+ publish = false
511
612[dependencies ]
713anyhow = { workspace = true }
Original file line number Diff line number Diff line change 11[package ]
22name = " stresstest"
3+ authors = [" Sentry <oss@sentry.io>" ]
4+ description = " Tool for generating file storage load against Objectstore servers"
5+ homepage = " https://getsentry.github.io/objectstore/"
6+ repository = " https://github.com/getsentry/objectstore"
7+ license-file = " ../LICENSE.md"
38version = " 0.1.0"
49edition = " 2024"
10+ publish = false
511
612[dependencies ]
713anyhow = { workspace = true }
You can’t perform that action at this time.
0 commit comments