|
| 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