Skip to content

Commit 8023b02

Browse files
committed
Add empty postgres KvStore implementation.
1 parent 219470f commit 8023b02

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

rust/impls/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "impls"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
async-trait = "0.1.77"
8+
api = { path = "../api" }

rust/impls/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod postgres_store;

rust/impls/src/postgres_store.rs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
use api::error::VssError;
2+
use api::kv_store::KvStore;
3+
use api::types::{
4+
DeleteObjectRequest, DeleteObjectResponse, GetObjectRequest, GetObjectResponse,
5+
ListKeyVersionsRequest, ListKeyVersionsResponse, PutObjectRequest, PutObjectResponse,
6+
};
7+
use async_trait::async_trait;
8+
use std::io::Error;
9+
10+
pub struct PostgresBackendImpl {}
11+
12+
impl PostgresBackendImpl {
13+
pub async fn new(dsn: &str) -> Result<Self, Error> {
14+
todo!("pending implementation.");
15+
}
16+
}
17+
18+
#[async_trait]
19+
impl KvStore for PostgresBackendImpl {
20+
async fn get(
21+
&self, user_token: String, request: GetObjectRequest,
22+
) -> Result<GetObjectResponse, VssError> {
23+
todo!("pending implementation.");
24+
}
25+
26+
async fn put(
27+
&self, user_token: String, request: PutObjectRequest,
28+
) -> Result<PutObjectResponse, VssError> {
29+
todo!("pending implementation.");
30+
}
31+
32+
async fn delete(
33+
&self, user_token: String, request: DeleteObjectRequest,
34+
) -> Result<DeleteObjectResponse, VssError> {
35+
todo!("pending implementation.");
36+
}
37+
38+
async fn list_key_versions(
39+
&self, user_token: String, request: ListKeyVersionsRequest,
40+
) -> Result<ListKeyVersionsResponse, VssError> {
41+
todo!("pending implementation.");
42+
}
43+
}

0 commit comments

Comments
 (0)