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/valenciaj/gg-redis-pool
Simple redis pool middleware for Gin-Gonic framework.
This middleware set on each request a redis connection (new or pooled), and can be accessed with context Get("Redis")
or MustGet("Redis")
method.
package main
import (
ggRedisPool "github.com/valenciaj/gg-redis-pool"
)
// Create server
srv := gin.Default()
dbConnStr =: "redis://@127.0.0.1:6379/0"
// Set middlewares
srv.Use(
gin.Recovery(),
ggRedisPool.Redis(dbConnStr),
)
// ... set other stuff ...
// Set routes
srv.GET("/", func(ctx *gin.Context) {
// With Get method
redisI, err := ctx.Get("Redis")
if err != nil {
panic(err)
}
// Unbox redis connection
redis := redisI.(*DB)
// With MustGet method
redis := ctx.MustGet("Redis").(*DB)
// ... do some stuff with redis connection ...
// Response data
ctx.HTML(200, "welcome/index.tmpl", gin.H{})
})
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.