-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
273 additions
and
140 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
pub struct BucketLimits { | ||
pub bucket_size_limit : usize, | ||
pub bucket_file_count_limit: usize, | ||
|
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,48 @@ | ||
use core::range::Range; | ||
use time::OffsetDateTime; | ||
|
||
/// CAS | ||
/// Compare and swap os usually the conditional part of a request that must be met inorder for the request to be able to be completed. | ||
pub enum BucketHash { | ||
Sha256([u8; 32]), | ||
Sha512([u8; 64]), | ||
None, | ||
// add more.. | ||
} | ||
|
||
|
||
pub struct DataForRange { | ||
/// Byte range to compare against. | ||
range: Range<u32>, | ||
/// You are only able to do 1 Kbyte of compare and swap for data. | ||
data: Vec<u8>, | ||
} | ||
|
||
|
||
|
||
|
||
pub enum Condition { | ||
BucketMetadataCondition(BucketMetadataCondition), | ||
FileCondition(FileCondition), | ||
} | ||
|
||
pub enum BucketMetadataCondition { | ||
Hash(BucketHash), /// Will compare the hash to see if it matches. | ||
Tag(Vec<String>), /// every tag is an entity in a collection, you are able to check the tags for it. | ||
ModifyDate(OffsetDateTime), /// When check if it's the last date. | ||
Name(String), | ||
Size(u64), | ||
} | ||
|
||
pub enum FileCondition { | ||
Range(DataForRange), | ||
/// Compares the entire file hash. Maybe TODO: Remove??? | ||
Data(BucketHash), | ||
|
||
Size(u64), | ||
} | ||
|
||
pub struct ConditionalRequest { | ||
|
||
} |
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
Oops, something went wrong.