Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to authenticate with redis servers #89

Merged
merged 2 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type RedisCacheConfig struct {
Protocol string `toml:"protocol"`
// Endpoint represents FQDN:port or IPAddress:Port of the Redis server
Endpoint string `toml:"endpoint"`
// Password can be set when using password protected redis instance.
Password string `toml:"password"`
}

// BoltDBCacheConfig is a collection of Configurations for storing cached data on the Filesystem
Expand Down
3 changes: 3 additions & 0 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func (r *RedisCache) Connect() error {
Network: r.Config.Protocol,
Addr: r.Config.Endpoint,
})
if r.Config.Password != "" {
r.client.Options().Password = r.Config.Password
}
return r.client.Ping().Err()
}

Expand Down