
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
radix is a package for Go that implements an asynchronous Redis client. radix was originally forked from the Tideland-rdc redis client (http://code.google.com/p/tideland-rdc/) developed by Frank Mueller.
go get github.com/fzzbt/radix
To run the tests:
cd $GOROOT/src/pkg/radix
go test -v -bench=".*"
Creating a Client instance is done as follows:
import "radix"
...
c := radix.NewClient(radix.Configuration{
Database: 0, // (default: 0)
// Timeout in seconds
Timeout: 10, // (default: 10)
// Custom TCP/IP address or Unix path. (default: Address: "127.0.0.1:6379")
// Address: "127.0.0.1:6379",
// Path: "/tmp/radix.sock"
//* Optional parameters
// Password for authenticating (default: "")
// Auth: "my_password",
// Size of the connection pool (default: 50)
// PoolSize: 50,
// Don't try to retry on LOADING error? (default: false)
// NoLoadingRetry: false,
})
defer c.Close()
As Redis is mostly a single threaded database, increasing the PoolSize parameter does not usually make much difference unless the latency to your server is very high. The default is set to 50 connections which should be fine for around 99.9% of cases. However, note that each Subscription instance requires its own connection until it's closed.
Sometimes Redis may give a LOADING error when it is loading keys from the disk. The default behaviour of radix is to retry connecting until Redis is done with it, but you may wish to override this behaviour with the NoLoadingRetry parameter.
Simple blocking commands are executed using Client.Command and Client.AsyncCommand methods. Executing multiple commands at once (pipelining) can be done with Client.MultiCommand or Client.Transaction methods. All of these methods return a Reply instance which contains the reply.
Here's a simple example how to call single commands:
reply := c.Command("set", "mykey", "myvalue")
if reply.Error() != nil {
fmt.Printf("set failed: %s\n", reply.Error())
return
}
reply = c.Command("get", "mykey")
if reply.Type() != radix.ReplyString {
fmt.Printf("get failed: %s\n", reply.Error())
return
}
fmt.Printf("mykey: %s\n", rep.Str())
The Client.Command method and alike take the command name as their first parameter, followed by variadic length ...interface{} parameter. The interface{} parameters are converted into byte strings as follows:
Furthermore, there is special handling for slices and maps, eg.
For more examples on how to use multi-commands, transactions, subscriptions and more,
take a look at the example program in example/example.go.
API reference is available in http://gopkgdoc.appspot.com/pkg/github.com/fzzbt/radix.
Alternatively, run godoc for API reference:
godoc -http=:8080
and point your browser to http://localhost:8080/pkg/github.com/fzzbt/radix.
If you make contributions to the project, please follow the guidelines below:
New developers should add themselves to the lists in AUTHORS and/or CONTRIBUTORS files, when submitting their first commit. See the CONTRIBUTORS file for details.
Copyright 2012 The "radix" Authors. See file AUTHORS and CONTRIBUTORS.
Unless otherwise noted, the source files are distributed under the
BSD 3-Clause License found in the LICENSE file.
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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.