Object storage abstraction with compare-and-swap writes (S3/R2/GCS)
Dependencies
pub(open) trait ObjectStore {
async fn get(Self, String) -> GetOutcome raise GitError
async fn get_range(Self, String, ByteRange) -> GetOutcome raise GitError
async fn get_if_none_match(Self, String, String) -> GetOutcome raise GitError
async fn put(Self, String, Bytes, PutCondition) -> PutOutcome raise GitError
async fn delete(Self, String) -> Unit raise GitError
async fn list(Self, String, String) -> ObjListing raise GitError
fn supports_cas(Self) -> Bool
}impl ObjectStore for FsStoreasync fn get_if_none_match(self : FsStore, key : String, etag : String) -> GetOutcome raise GitErrorasync fn put(self : FsStore, key : String, body : Bytes, condition : PutCondition) -> PutOutcome raise GitErrorimpl Show for GetOutcomepub struct MemStore {
objects : Map[String, Bytes]
fail_puts_unknown : Int
silent_puts : Int
page_size : Int
}impl ObjectStore for MemStoreasync fn get_if_none_match(self : MemStore, key : String, etag : String) -> GetOutcome raise GitErrorasync fn put(self : MemStore, key : String, body : Bytes, condition : PutCondition) -> PutOutcome raise GitErrorimpl Show for PutConditionimpl Show for PutOutcomepub(all) struct S3Config {
endpoint : String
region : String
bucket : String
access_key_id : String
secret_access_key : String
session_token : String?
path_style : Bool
}impl ObjectStore for S3Storeasync fn get_if_none_match(self : S3Store, key : String, etag : String) -> GetOutcome raise GitErrorasync fn put(self : S3Store, key : String, body : Bytes, condition : PutCondition) -> PutOutcome raise GitErrorpub(all) struct SignedRequest {
verb : String
url : String
headers : Map[String, String]
body : Bytes
}fn civil_from_days(days : Int64) -> (Int, Int, Int)fn format_amz_date(epoch_seconds : Int64) -> Stringfn lex_compare(a : String, b : String) -> Intfn mem_etag(body : Bytes) -> Stringasync fn[S : ObjectStore] put_immutable(store : S, key : String, body : Bytes) -> PutOutcome raise GitErrorfn sign_s3_request(config : S3Config, verb : String, path : String, query : Array[(String, String)], headers : Map[String, String], body : Bytes, amz_date : String) -> SignedRequest raise GitErrorfn strip_etag_quotes(etag : String) -> Stringfn uri_encode(value : String, encode_slash : Bool) -> Stringfn xml_unescape(value : String) -> StringInstall
Download zipObject storage abstraction with compare-and-swap writes (S3/R2/GCS)
Dependencies