Skip to content

Commit

Permalink
pass tls config options to redis cluster init
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblakeley authored and buger committed Mar 21, 2018
1 parent 1c90a43 commit 329c7fb
Show file tree
Hide file tree
Showing 40 changed files with 6,662 additions and 302 deletions.
Binary file added .DS_Store
Binary file not shown.
22 changes: 12 additions & 10 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ type DBAppConfOptionsConfig struct {
}

type StorageOptionsConf struct {
Type string `json:"type"`
Host string `json:"host"`
Port int `json:"port"`
Hosts map[string]string `json:"hosts"`
Username string `json:"username"`
Password string `json:"password"`
Database int `json:"database"`
MaxIdle int `json:"optimisation_max_idle"`
MaxActive int `json:"optimisation_max_active"`
EnableCluster bool `json:"enable_cluster"`
Type string `json:"type"`
Host string `json:"host"`
Port int `json:"port"`
Hosts map[string]string `json:"hosts"`
Username string `json:"username"`
Password string `json:"password"`
Database int `json:"database"`
MaxIdle int `json:"optimisation_max_idle"`
MaxActive int `json:"optimisation_max_active"`
EnableCluster bool `json:"enable_cluster"`
UseSSL bool `json:"use_ssl"`
SSLInsecureSkipVerify bool `json:"ssl_insecure_skip_verify"`
}

type NormalisedURLConfig struct {
Expand Down
6 changes: 6 additions & 0 deletions lint/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const confSchema = `{
"enable_cluster": {
"type": "boolean"
},
"use_ssl":{
"type": "boolean"
},
"ssl_insecure_skip_verify":{
"type": "boolean"
},
"host": {
"type": "string",
"format": "host-no-port"
Expand Down
16 changes: 9 additions & 7 deletions storage/redis_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/Sirupsen/logrus"
"github.com/garyburd/redigo/redis"
"github.com/lonelycode/redigocluster/rediscluster"
"github.com/satori/go.uuid"

"github.com/TykTechnologies/redigocluster/rediscluster"
"github.com/TykTechnologies/tyk/config"
)

Expand Down Expand Up @@ -115,12 +115,14 @@ func NewRedisClusterPool(isCache bool) *rediscluster.RedisCluster {
}

poolConf := rediscluster.PoolConfig{
MaxIdle: maxIdle,
MaxActive: maxActive,
IdleTimeout: 240 * time.Second,
Database: cfg.Database,
Password: cfg.Password,
IsCluster: cfg.EnableCluster,
MaxIdle: maxIdle,
MaxActive: maxActive,
IdleTimeout: 240 * time.Second,
Database: cfg.Database,
Password: cfg.Password,
IsCluster: cfg.EnableCluster,
UseTLS: cfg.UseSSL,
TLSSkipVerify: cfg.SSLInsecureSkipVerify,
}

seed_redii := []map[string]string{}
Expand Down
202 changes: 202 additions & 0 deletions vendor/github.com/TykTechnologies/gojsonschema/LICENSE-APACHE-2.0.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 329c7fb

Please sign in to comment.