Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
github.com/hzxgo/redis
redis orm by golang 目前对redis的方法支持不全,需要的时候后期再添加
package main
import (
"github.com/hzxgo/log"
"github.com/hzxgo/redis"
)
func main() {
address := "127.0.0.1:6379"
db := 1
timeout := 3
auth := "redis_auth_string"
// instance := "main"
// init redis
// 指定实例名称初始化:redis.Init(address, db, timeout, auth, instance)
err := redis.Init(address, db, timeout, auth)
if err != nil {
log.Errorf("redis init | %v", err)
return
}
// redis set
// 指定实例:redis.Set(rdsUsername, "hezhixiong", instance)
rdsUsername := "test:username"
err = redis.Set(rdsUsername, "hezhixiong")
if err != nil {
log.Errorf("redis set %s | %v", rdsUsername, err)
return
}
// redis get
username, err := redis.Get(rdsUsername)
if err != nil {
log.Errorf("redis get %s | %v", rdsUsername, err)
return
}
log.Infof("username: %s", username)
}
rc := make([]*redis.RdsCfg, len(Config.Redis))
for i, v := range Config.Redis {
rc[i] = &redis.RdsCfg{
Instance: v.Instance,
Address: v.Address,
DB: v.Db,
Auth: v.Auth,
Timeout: v.Timeout,
IsDefault: v.IsDefault,
}
}
if err := redis.BatchInit(rc); err != nil {
log.Errorf("batch init redis | %v", err)
return
}
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.