Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.