Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
github.com/fananchong/go-redis-orm
redis orm base on protobuf
更详细内容,请参见:http://blog.csdn.net/u013272009/article/details/78574079
package main
import (
"fmt"
"github.com/fananchong/go-redis-orm"
)
func main() {
dbName := "db1"
go_redis_orm.SetNewRedisHandler(go_redis_orm.NewDefaultRedisClient)
go_redis_orm.CreateDB(dbName, []string{"192.168.1.4:16379"}, "", 0)
// key值为1的 TestStruct2 数据
data2 := NewRD_TestStruct2(1)
data2.F1 = "bbb"
err := data2.Save(dbName)
if err != nil {
panic("#1")
}
err = data2.Load(dbName)
if err == nil {
if data2.F1 != "bbb" {
panic("#2")
}
} else {
panic("#3")
}
err = data2.Delete(dbName)
if err != nil {
panic("#5")
}
err = data2.Load(dbName)
if data2.F1 != "" {
panic("#6")
}
fmt.Println("OK")
}
本库支持第3方redis客户端整合进本项目,通过调用go_redis_orm.SetNewRedisHandler函数
需要实现go_redis_orm.IClient接口
type IClient interface {
Get(key string) ([]byte, error)
Set(key string, data []byte) error
Del(key string) error
}
详细参见:http://blog.csdn.net/u013272009/article/details/78513251
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.