GodownGo 開發(fā)的?分布式 Key-Value 數(shù)據(jù)庫
Godown 是一個(gè) Go 語言開發(fā)的簡單、高效分布式 Key-Value 數(shù)據(jù)庫,靈感來源 Redis,基于 Raft 協(xié)議,支持 String, Bitmap, Map, List。
演示視頻
使用示例
通過 Go 客戶端進(jìn)行連接
package main
import ( "fmt"
"github.com/namreg/godown/client")
func main() {
c, err := client.New("127.0.0.1:4000")
if err != nil {
panic(err)
}
defer c.Close()
res := c.Get("key")
if res.Err() != nil {
panic(res.Err())
}
if res.IsNil() {
fmt.Print("key does not exist")
} else {
fmt.Println(res.Int64())
}
}評論
圖片
表情
