https://github.com/tech-branch/tbkv
A simple zero-dependency in-memory key-value store for Golang
https://github.com/tech-branch/tbkv
go golang key-value-store
Last synced: 5 months ago
JSON representation
A simple zero-dependency in-memory key-value store for Golang
- Host: GitHub
- URL: https://github.com/tech-branch/tbkv
- Owner: tech-branch
- License: mit
- Created: 2022-08-16T22:38:23.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-17T22:32:55.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T08:09:47.269Z (almost 2 years ago)
- Topics: go, golang, key-value-store
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README


## TBKV key-val store
You're looking at a simple zero-dependency in-memory key-value store for Golang.
All operations (Get/Set/Delete) are executed in a single, buffered loop, so the store provides some thread safety.
The package is continuously scanned by `semgrep` and various static code critics to maintain healthy security posture.
The main `tbkv` package has 100% test coverage and my aim is to maintain that.
The `examples` are covered to the extent of checking if the scenario runs successfully.
### Usage
```Golang
import (
"github.com/tech-branch/tbkv"
)
func main() {
kvs := NewDefaultStore()
kvs.Set("key", "value")
val, err := kvs.Get("key")
if err != nil {
return err
}
// val == "value"
kvs.Delete("key")
val, err := kvs.Get("key")
if err != nil {
// err == tbkv.ErrNotFound
return err
}
}
```
See a more complete example in `./examples/main.go`