Skip to content

Embedded key value store with persistence mode, based on golang & badger KV

Notifications You must be signed in to change notification settings

titikterang/hybrid-kvstore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sources

- https://dgraph.io/docs/badger/get-started/
- https://github.com/dgraph-io/badger

get badger kv value

//kv store - in memory mode
curl --location --request GET 'localhost:8080/item/volatile'
//kv store - persistence mode
curl --location --request GET 'localhost:8080/item/persistence'

add new item to kv store

curl --location --request POST 'localhost:8080/item' \
--header 'Content-Type: application/json' \
--data-raw '{
    "file_name":"sample-file.csv",
	"user_id":123456,
	"known_category":false,
	"status":"pending",
	"file_path":"report/22334455.csv"
}'

update item in kv store

curl --location --request POST 'localhost:8080/item/update' \
--header 'Content-Type: application/json' \
--data-raw '{
    "file_name":"inactive-gunpla-kit6.csv",
	"user_id":123456,
	"known_category":false,
	"status":"in-progress",
	"file_path":"report/22334455.csv",
    "index": "m_16_10_2020_10_59_01"
}'

set new item with ttl 15seconds

curl --location --request POST 'localhost:8080/item/ttl' \
--header 'Content-Type: application/json' \
--data-raw '{
    "file_name":"repot-ttl.csv",
	"user_id":123456,
	"known_category":false,
	"status":"pending",
	"file_path":"report/22334455.csv"
}'

About

Embedded key value store with persistence mode, based on golang & badger KV

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%