URL parsing for redis (#64)

* URL parsing for redis

Co-authored-by: TroyDota <49777269+TroyDota@users.noreply.github.com>
This commit is contained in:
RW
2021-03-25 08:14:30 +01:00
committed by GitHub
parent 39d7f4ff11
commit 79bb924d44
4 changed files with 60 additions and 6 deletions

View File

@@ -27,6 +27,12 @@ type Config struct {
// Optional. Default is 0
Database int
// URL the standard format redis url to parse all other options. If this is set all other config options, Host, Port, Username, Password, Database have no effect.
//
// Example: redis://<user>:<pass>@localhost:6379/<db>
// Optional. Default is ""
URL string
// Reset clears any existing keys in existing Collection
//
// Optional. Default is false
@@ -45,6 +51,7 @@ var ConfigDefault = Config{
Port: 6379,
Username: "",
Password: "",
URL: "",
Database: 0,
Reset: false,
}