Overview
goukv
is an abstraction layer for golang based key-value stores, it is easy to add any backend provider.
Available Providers
Why
I just built this to be used in my side projects, but you can use it with no worries, it is production ready, and I'm open for any idea & contribution.
Backend Stores Rules
just keep it simple stupid!
-
Use the
map[string]interface{}as your options. -
Nilvalue means DELETE . -
Respect the
Entrystruct. -
Respect the
ScanOptsstruct.
Example
package main
import (
"time"
"fmt"
"github.com/alash3al/goukv"
_ "github.com/alash3al/goukv/providers/goleveldb"
)
func main() {
db, err := goukv.Open("goleveldb", map[string]interface{}{
"path": "./db",
})
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")))
}
以上所述就是小编给大家介绍的《goukv - an abstraction layer for golang based key-value stores》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
深度探索C++对象模型
斯坦利•B.李普曼 (Stanley B. Lippman) / 侯捷 / 电子工业出版社 / 2012-1 / 69.00元
作者Lippman参与设计了全世界第一套C++编译程序cfront,这本书就是一位伟大的C++编译程序设计者向你阐述他如何处理各种explicit(明确出现于C++程序代码中)和implicit(隐藏于程序代码背后)的C++语意。 本书专注于C++面向对象程序设计的底层机制,包括结构式语意、临时性对象的生成、封装、继承,以及虚拟——虚拟函数和虚拟继承。这本书让你知道:一旦你能够了解底层实现模......一起来看看 《深度探索C++对象模型》 这本书的介绍吧!