Skip to content

Commit

Permalink
Compiling with todos for new functionality
Browse files Browse the repository at this point in the history
Signed-off-by: Darwin Boersma <[email protected]>
  • Loading branch information
ogghead committed Nov 5, 2024
1 parent 407182d commit 917f811
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions crates/key-value-aws/src/store.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::sync::Arc;
use std::{collections::HashMap, sync::Arc};

use anyhow::Result;
use aws_config::{BehaviorVersion, Region, SdkConfig};
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::{
config::{ProvideCredentials, SharedCredentialsProvider},
primitives::Blob,
types::AttributeValue,
types::{AttributeValue, KeysAndAttributes},
Client,
};
use spin_core::async_trait;
Expand Down Expand Up @@ -127,6 +127,13 @@ struct AwsDynamoStore {
table: String,
}

// struct CompareAndSwap {
// key: String,
// client: CollectionClient,
// bucket_rep: u32,
// etag: Mutex<Option<String>>,
// }

const PK: &str = "PK";
const VAL: &str = "val";

Expand Down Expand Up @@ -169,6 +176,30 @@ impl Store for AwsDynamoStore {
async fn get_keys(&self) -> Result<Vec<String>, Error> {
self.get_keys().await
}

async fn get_many(&self, keys: Vec<String>) -> Result<Vec<(String, Option<Vec<u8>>)>, Error> {
todo!()
}

async fn set_many(&self, key_values: Vec<(String, Vec<u8>)>) -> Result<(), Error> {
todo!()
}

async fn delete_many(&self, keys: Vec<String>) -> Result<(), Error> {
todo!()
}

async fn increment(&self, key: String, delta: i64) -> Result<i64, Error> {
todo!()
}

async fn new_compare_and_swap(
&self,
bucket_rep: u32,
key: &str,
) -> Result<Arc<dyn spin_factor_key_value::Cas>, Error> {
todo!()
}
}

impl AwsDynamoStore {
Expand Down

0 comments on commit 917f811

Please sign in to comment.