garage/src/k2v-client
Alex Auvolat bcbd15da84
All checks were successful
ci/woodpecker/pr/debug Pipeline was successful
ci/woodpecker/push/debug Pipeline was successful
[dep-upgrade-202402] cargo clippy fixes
2024-02-08 23:29:57 +01:00
..
bin introduce dedicated return type for PollRange 2023-06-24 10:17:20 +02:00
Cargo.toml [dep-upgrade-202402] upgrade to http/hyper 1.x for tests 2024-02-05 19:57:35 +01:00
error.rs [dep-upgrade-202402] upgrade to http/hyper 1.x for tests 2024-02-05 19:57:35 +01:00
lib.rs [dep-upgrade-202402] cargo clippy fixes 2024-02-08 23:29:57 +01:00
README.md Add a K2V client library and CLI (#303) 2022-05-18 22:24:09 +02:00

Example usage:

# all these values can be provided on the cli instead
export AWS_ACCESS_KEY_ID=GK123456
export AWS_SECRET_ACCESS_KEY=0123..789
export AWS_REGION=garage
export K2V_ENDPOINT=http://172.30.2.1:3903
export K2V_BUCKET=my-bucket

cargo run --features=cli -- read-range my-partition-key --all

cargo run --features=cli -- insert my-partition-key my-sort-key --text "my string1"
cargo run --features=cli -- insert my-partition-key my-sort-key --text "my string2"
cargo run --features=cli -- insert my-partition-key my-sort-key2 --text "my string"

cargo run --features=cli -- read-range my-partition-key --all

causality=$(cargo run --features=cli -- read my-partition-key my-sort-key2 -b | head -n1)
cargo run --features=cli -- delete my-partition-key my-sort-key2 -c $causality

causality=$(cargo run --features=cli -- read my-partition-key my-sort-key -b | head -n1)
cargo run --features=cli -- insert my-partition-key my-sort-key --text "my string3" -c $causality

cargo run --features=cli -- read-range my-partition-key --all