文件名称:goleveldb:Go中的LevelDB键值数据库
文件大小:198KB
文件格式:ZIP
更新时间:2024-02-23 09:41:26
go database leveldb GoGo
这是的实现。 安装 go get github.com/syndtr/goleveldb/leveldb 要求 至少需要go1.5或更高版本。 用法 创建或打开数据库: // The returned DB instance is safe for concurrent use. Which mean that all // DB's methods may be called concurrently from multiple goroutine. db , err := leveldb . OpenFile ( "path/to/db" , nil ) ... defer db . Close () ... 读取或修改数据库内容: // Remember that the contents of the returned slice should not be modified. data , err := db . Get ([] byte ( "key" ), nil ) ... err = db . Put ([] byte ( "key" ), [] byte (