mirror of
https://github.com/gofiber/storage.git
synced 2025-10-21 07:40:36 +08:00
✨ enhancement(redis): add TLSConfig (#261)
* TLSConfig * Update README.md * add tls tests and certs * Update test-redis.yml * Update test-redis.yml * Update test-redis.yml * Update test-redis.yml * Update test-redis.yml correct tls port * Update test-redis.yml path * Update test-redis.yml
This commit is contained in:
@@ -25,15 +25,17 @@ func New(config ...Config) *Storage {
|
||||
|
||||
if cfg.URL != "" {
|
||||
options, err = redis.ParseURL(cfg.URL)
|
||||
options.TLSConfig = cfg.TLSConfig
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
options = &redis.Options{
|
||||
Addr: fmt.Sprintf("%s:%d", cfg.Host, cfg.Port),
|
||||
DB: cfg.Database,
|
||||
Username: cfg.Username,
|
||||
Password: cfg.Password,
|
||||
Addr: fmt.Sprintf("%s:%d", cfg.Host, cfg.Port),
|
||||
DB: cfg.Database,
|
||||
Username: cfg.Username,
|
||||
Password: cfg.Password,
|
||||
TLSConfig: cfg.TLSConfig,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user