Skip to content

Commit

Permalink
Rolled back config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
guscarreon committed Sep 26, 2023
1 parent 79cf4fe commit 6fb3224
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backends/ignite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ func TestCreateCache(t *testing.T) {
igniteError: nil,
},
expected: testOutput{
err: errors.New(`Ignite error. successStatus does not equal 0 { 1}`),
err: errors.New(`Ignite error. successStatus does not equal 0 { 1}`),
},
},
{
Expand Down
20 changes: 9 additions & 11 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
port: 2424
admin_port: 2525
log:
Expand All @@ -7,24 +6,23 @@ rate_limiter:
enabled: true
num_requests: 100
request_limits:
allow_setting_keys: true
max_size_bytes: 10240
allow_setting_keys: false
max_size_bytes: 10240 # 10K
max_num_values: 10
max_ttl_seconds: 3600
backend:
type: "memory" # Switch to be "aerospike", "cassandra", "memcache" or "redis" for production.
aerospike:
hosts: ["aerospike.prebid.com"]
hosts: [ "aerospike.prebid.com" ]
port: 3000
namespace: "whatever"
cassandra:
hosts: "127.0.0.1"
keyspace: "prebid"
memcache:
config_host: "" # Auto discovery config endpoint. Docker build Replaced
poll_interval_seconds: 30 # Node change interval when in auto discovery
hosts: "10.0.0.1:11211" # List of nodes when not in auto discovery. Can
# also use an array for multiple hosts.
config_host: "" # Configuration endpoint for auto discovery. Replaced at docker build.
poll_interval_seconds: 30 # Node change polling interval when auto discovery is used
hosts: "10.0.0.1:11211" # List of nodes when not using auto discovery. Can also use an array for multiple hosts.
redis:
host: "127.0.0.1"
port: 6379
Expand All @@ -40,10 +38,10 @@ backend:
port: 8080
secure: false
headers: !!omap
- Host: prebid.adnxs.com
- Content-Length: 0
cache:
name: "myCache"
create_on_start: true
name: "whatever"
create_on_start: false
compression:
type: "snappy" # Can also be "none"
metrics:
Expand Down
7 changes: 7 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ func setConfigDefaults(v *viper.Viper) {
v.SetDefault("backend.redis.expiration", utils.REDIS_DEFAULT_EXPIRATION_MINUTES)
v.SetDefault("backend.redis.tls.enabled", false)
v.SetDefault("backend.redis.tls.insecure_skip_verify", false)
v.SetDefault("backend.ignite.scheme", "")
v.SetDefault("backend.ignite.host", "")
v.SetDefault("backend.ignite.port", 0)
v.SetDefault("backend.ignite.secure", false)
v.SetDefault("backend.ignite.headers", map[string]string{})
v.SetDefault("backend.ignite.cache.name", "")
v.SetDefault("backend.ignite.cache.create_on_start", false)
v.SetDefault("compression.type", "snappy")
v.SetDefault("metrics.influx.enabled", false)
v.SetDefault("metrics.influx.host", "")
Expand Down
15 changes: 15 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,9 @@ func getExpectedDefaultConfig() Configuration {
Redis: Redis{
ExpirationMinutes: utils.REDIS_DEFAULT_EXPIRATION_MINUTES,
},
Ignite: Ignite{
Headers: map[string]string{},
},
},
Compression: Compression{
Type: CompressionType("snappy"),
Expand Down Expand Up @@ -1274,6 +1277,18 @@ func getExpectedFullConfigForTestFile() Configuration {
InsecureSkipVerify: false,
},
},
Ignite: Ignite{
Scheme: "http",
Host: "127.0.0.1",
Port: 8080,
Headers: map[string]string{
"Content-Length": "0",
},
Cache: IgniteCache{
Name: "whatever",
CreateOnStart: false,
},
},
},
Compression: Compression{
Type: CompressionType("snappy"),
Expand Down
10 changes: 10 additions & 0 deletions config/configtest/sample_full_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ backend:
tls:
enabled: false
insecure_skip_verify: false
ignite:
scheme: "http"
host: "127.0.0.1"
port: 8080
secure: false
headers: !!omap
- Content-Length: 0
cache:
name: "whatever"
create_on_start: false
compression:
type: "snappy"
metrics:
Expand Down

0 comments on commit 6fb3224

Please sign in to comment.