aboutsummaryrefslogtreecommitdiff
path: root/src/storage/garage.rs
blob: 052e812b031521b64c1fa8c07732278d85cdd823 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
use crate::storage::*;

#[derive(Clone, Debug, Hash)]
pub struct GrgCreds {
    pub region: String,
    pub s3_endpoint: String,
    pub k2v_endpoint: String,
    pub aws_access_key_id: String,
    pub aws_secret_access_key: String,
    pub bucket: String,
}
pub struct GrgStore {}
pub struct GrgRef {}
pub struct GrgValue {}

#[derive(Clone, Debug, PartialEq)]
pub struct GrgOrphanRowRef {}

impl IBuilders for GrgCreds {
    fn row_store(&self) -> Result<RowStore, StorageError> {
        unimplemented!();
    }

    fn blob_store(&self) -> Result<BlobStore, StorageError> {
        unimplemented!();
    }

    fn url(&self) -> &str {
        return "grg://unimplemented;"
    }
}

impl IRowStore for GrgStore {
    fn row(&self, partition: &str, sort: &str) -> RowRef {
        unimplemented!();
    }

    fn select(&self, selector: Selector) -> AsyncResult<Vec<RowValue>> {
        unimplemented!();
    }

    fn rm(&self, selector: Selector) -> AsyncResult<()> {
        unimplemented!();
    }

    fn from_orphan(&self, orphan: OrphanRowRef) -> Result<RowRef, StorageError> {
        unimplemented!();
    }
}

impl IRowRef for GrgRef {
    /*fn clone_boxed(&self) -> RowRef {
        unimplemented!();
    }*/
    fn to_orphan(&self) -> OrphanRowRef {
        unimplemented!()
    }

    fn key(&self) -> (&str, &str) {
        unimplemented!();
    }

    fn set_value(&self, content: &[u8]) -> RowValue {
        unimplemented!();
    }
    fn fetch(&self) -> AsyncResult<RowValue> {
        unimplemented!();
    }
    fn rm(&self) -> AsyncResult<()> {
        unimplemented!();
    }
    fn poll(&self) -> AsyncResult<RowValue> {
        unimplemented!();
    }
}

impl std::fmt::Debug for GrgRef {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        unimplemented!();
    }
}

impl IRowValue for GrgValue {
    fn to_ref(&self) -> RowRef {
        unimplemented!();
    }
    fn content(&self) -> ConcurrentValues {
        unimplemented!();
    }
    fn push(&self) -> AsyncResult<()> {
        unimplemented!();
    }
}

impl std::fmt::Debug for GrgValue {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        unimplemented!();
    }
}


/*
/// A custom S3 region, composed of a region name and endpoint.
/// We use this instead of rusoto_signature::Region so that we can
/// derive Hash and Eq


#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub struct Region {
    pub name: String,
    pub endpoint: String,
}

impl Region {
    pub fn as_rusoto_region(&self) -> rusoto_signature::Region {
        rusoto_signature::Region::Custom {
            name: self.name.clone(),
            endpoint: self.endpoint.clone(),
        }
    }
}
*/

/*
pub struct Garage {
    pub s3_region: Region,
    pub k2v_region: Region,

    pub aws_access_key_id: String,
    pub aws_secret_access_key: String,
    pub bucket: String,
}

impl StoreBuilder<> for Garage {
    fn row_store(&self) -> 
}

pub struct K2V {}
impl RowStore for K2V {

}*/