Parses a Redis url and returns result as a struct
Install redisurl using the "go get" command:
$ go get github.com/bgv/redisurl
The Go distribution is redisurl's only dependency.
Import github.com/bgv/redisurl
and use as:
url, err := redisurl.Parse("redis://:[email protected]:6379/5")
if err != nil {
log.Fatal(err)
}
which will return the following struct
// Redis Info:
url.Host: 127.0.0.1
url.Port: 6379
url.Password: v3rys3cr37
url.Db: 5
url.Hostname: 127.0.0.1:6379
The LICENSE