-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new crate stac-object-store-cache and import from it in core
- Loading branch information
Showing
10 changed files
with
175 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[package] | ||
name = "stac-object-store-cache" | ||
description = "Create and cache object stores based on url in stac." | ||
version = "0.1.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
repository.workspace = true | ||
license.workspace = true | ||
categories.workspace = true | ||
rust-version.workspace = true | ||
|
||
[features] | ||
object-store-aws = ["object_store/aws"] | ||
object-store-azure = ["object_store/azure"] | ||
object-store-gcp = ["object_store/gcp"] | ||
object-store-http = ["object_store/http"] | ||
object-store-all = [ | ||
"object-store-aws", | ||
"object-store-azure", | ||
"object-store-gcp", | ||
"object-store-http", | ||
] | ||
|
||
|
||
[dependencies] | ||
object_store = { workspace = true } | ||
once_cell = { workspace = true } | ||
thiserror.workspace = true | ||
tokio = { workspace = true } | ||
url = { workspace = true, features = ["serde"] } | ||
|
||
[dev-dependencies] | ||
tokio = { workspace = true, features = ["macros"] } | ||
tokio-test.workspace = true |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use object_store::ObjectStoreScheme; | ||
use thiserror::Error; | ||
|
||
/// Error enum for crate-specific errors. | ||
#[derive(Error, Debug)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
/// TODO: Better error description | ||
#[error("Failed to create object_store for {scheme:?}. Check if required feature is enabled.")] | ||
ObjectStoreCreate { | ||
/// feature | ||
scheme: ObjectStoreScheme, | ||
}, | ||
|
||
/// [url::ParseError] | ||
#[error(transparent)] | ||
UrlParse(#[from] url::ParseError), | ||
|
||
/// [object_store::Error] | ||
#[error(transparent)] | ||
ObjectStore(#[from] object_store::Error), | ||
|
||
/// [object_store::path::Error] | ||
#[error(transparent)] | ||
ObjectStorePath(#[from] object_store::path::Error), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Work with [ObjectStore](object_store::ObjectStore) in STAC. | ||
//! | ||
//! Features: | ||
//! - cache used objects_stores based on url and options | ||
//! - read cloud creadentials from env | ||
//! | ||
mod cache; | ||
mod error; | ||
|
||
pub use cache::parse_url_opts; | ||
|
||
pub use error::Error; | ||
|
||
/// Custom [Result](std::result::Result) type for this crate. | ||
pub type Result<T> = std::result::Result<T, Error>; |