An open API service indexing awesome lists of open source software.

https://github.com/vcaesar/store

Go common key-val database API
https://github.com/vcaesar/store

database go key-value

Last synced: about 1 month ago
JSON representation

Go common key-val database API

Awesome Lists containing this project

README

          

# store

## Examples
```go
package main

import (
"fmt"
"log"
"os"

"github.com/vcaesar/store"
)

func main() {
TestDBName := "test.db"
db, err := store.Open(TestDBName, "badger")
if err != nil {
log.Fatal("Store open: ", err)
}
log.Println("db test...")
os.MkdirAll(TestDBName, 0777)

err = db.Set([]byte("key1"), []byte("value1"))
if err != nil {
fmt.Println("db set: ", err)
}

has, err := db.Has([]byte("key1"))
fmt.Println("db has: ", has, err)

buf, err := db.Get([]byte("key1"))
fmt.Println("db get: ", string(buf), err)

db.Close()
// os.RemoveAll(TestDBName)
}

```