aboutsummaryrefslogtreecommitdiff
path: root/src/model/bucket_table.rs
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-05-02 23:13:08 +0200
committerAlex Auvolat <alex@adnab.me>2021-05-03 22:15:09 +0200
commite4b9e4e24d006373a20cfcbdac9dba5e399ee182 (patch)
tree620e24d182e6db4ad7ddca274eb8071d8241a1d6 /src/model/bucket_table.rs
parent6644df6b969df3f7ff0516ab7acd9b600dff0a54 (diff)
downloadgarage-e4b9e4e24d006373a20cfcbdac9dba5e399ee182.tar.gz
garage-e4b9e4e24d006373a20cfcbdac9dba5e399ee182.zip
rename types to CamelCase
Diffstat (limited to 'src/model/bucket_table.rs')
-rw-r--r--src/model/bucket_table.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/model/bucket_table.rs b/src/model/bucket_table.rs
index 9f89dccc..168ed713 100644
--- a/src/model/bucket_table.rs
+++ b/src/model/bucket_table.rs
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
-use garage_table::crdt::CRDT;
+use garage_table::crdt::Crdt;
use garage_table::*;
use crate::key_table::PermissionSet;
@@ -15,7 +15,7 @@ pub struct Bucket {
/// Name of the bucket
pub name: String,
/// State, and configuration if not deleted, of the bucket
- pub state: crdt::LWW<BucketState>,
+ pub state: crdt::Lww<BucketState>,
}
/// State of a bucket
@@ -27,7 +27,7 @@ pub enum BucketState {
Present(BucketParams),
}
-impl CRDT for BucketState {
+impl Crdt for BucketState {
fn merge(&mut self, o: &Self) {
match o {
BucketState::Deleted => *self = BucketState::Deleted,
@@ -44,22 +44,22 @@ impl CRDT for BucketState {
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub struct BucketParams {
/// Map of key with access to the bucket, and what kind of access they give
- pub authorized_keys: crdt::LWWMap<String, PermissionSet>,
+ pub authorized_keys: crdt::LwwMap<String, PermissionSet>,
/// Is the bucket served as http
- pub website: crdt::LWW<bool>,
+ pub website: crdt::Lww<bool>,
}
impl BucketParams {
/// Create an empty BucketParams with no authorized keys and no website accesss
pub fn new() -> Self {
BucketParams {
- authorized_keys: crdt::LWWMap::new(),
- website: crdt::LWW::new(false),
+ authorized_keys: crdt::LwwMap::new(),
+ website: crdt::Lww::new(false),
}
}
}
-impl CRDT for BucketParams {
+impl Crdt for BucketParams {
fn merge(&mut self, o: &Self) {
self.authorized_keys.merge(&o.authorized_keys);
self.website.merge(&o.website);
@@ -77,7 +77,7 @@ impl Bucket {
pub fn new(name: String) -> Self {
Bucket {
name,
- state: crdt::LWW::new(BucketState::Present(BucketParams::new())),
+ state: crdt::Lww::new(BucketState::Present(BucketParams::new())),
}
}
@@ -105,7 +105,7 @@ impl Entry<EmptyKey, String> for Bucket {
}
}
-impl CRDT for Bucket {
+impl Crdt for Bucket {
fn merge(&mut self, other: &Self) {
self.state.merge(&other.state);
}