GithubHelp home page GithubHelp logo

gkv's Introduction

gkv

gkv is an embeddable, persistent, simple key/value(KV) database adapter for Go.

Build Status GoDoc

This package depends on third-party databases.

Features

  • Out of the box, easy to use.
  • Basic, common, pure Go.
  • Support multiple databases.

Databases

Installing

go get -u github.com/WindomZ/gkv/...

Usage

import (
	"github.com/WindomZ/gkv"
	_ "github.com/WindomZ/gkv/bolt"
)
...

// init db
db := Open("../data/bolt.db")
db.Register([]byte("tablename"))
...

// put the value for a key
db.Put([]byte("key1"), []byte("value1"))
db.Put([]byte("key2"), []byte("value2"))
...

// get the value for a key
demo.Get([]byte("key1"))
demo.Get([]byte("key2"))

If you want to switch between different databases, just change import _ "github.com/WindomZ/gkv/bolt".

For example:

  • bolt - import _ "github.com/WindomZ/gkv/bolt"
  • badger - import _ "github.com/WindomZ/gkv/badger"
  • leveldb - import _ "github.com/WindomZ/gkv/leveldb"
  • buntdb - import _ "github.com/WindomZ/gkv/buntdb"
  • sqlite3 - import _ "github.com/WindomZ/gkv/sqlite3"

Easy to switch, choose the most suitable database.

Contributing

Welcome to pull requests, report bugs, suggest ideas and discuss on issues page.

If you like it then you can put a โญ on it.

gkv's People

Contributors

windomz avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.