Goukv Save

a key-value store with multiple backends including leveldb, badgerdb, postgresql

Project README

Overview

goukv is an abstraction layer for golang based key-value stores, it is easy to add any backend provider.

Available Providers

Backend Stores Rules

just keep it simple stupid!

  • Nil value means DELETE.
  • Respect the Entry struct.
  • Respect the ScanOpts struct.
  • On key not found, return goukv.ErrKeyNotFound, this replaces has().

Example

package main

import (
    "time"
    "fmt"
    "github.com/alash3al/goukv" 
    _ "github.com/alash3al/goukv/providers/leveldb"
)

func main() {
    db, err := goukv.Open("leveldb", "./")

    if err != nil {
        panic(err.Error())
    }

    defer db.Close()

    db.Put(&goukv.Entry{
        Key: []byte("k1"),
        Value: []byte("v1"),
        TTL: time.Second * 10,
    })

    fmt.Println(db.Get([]byte("k1")))
}

Open Source Agenda is not affiliated with "Goukv" Project. README Source: alash3al/goukv
Stars
53
Open Issues
0
Last Commit
2 years ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating