Skip to content

Commit

Permalink
Add default values for the config options
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed May 30, 2024
1 parent c17e0d4 commit 258a775
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ func (c *Config) LoadDefaults(ctx context.Context) *gerr.GatewayDError {
PolicyTimeout: DefaultPolicyTimeout,
ActionTimeout: DefaultActionTimeout,
Policies: []Policy{},
ActionRedis: ActionRedisConfig{},
ActionRedis: ActionRedisConfig{
Enabled: DefaultActionRedisEnabled,
Address: DefaultRedisAddress,
Channel: DefaultRedisChannel,
},
}

if c.GlobalKoanf != nil {
Expand Down
9 changes: 6 additions & 3 deletions config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ const (
DefaultCompatibilityPolicy = Strict

// Act.
DefaultPolicy = "passthrough"
DefaultPolicyTimeout = 30 * time.Second
DefaultActionTimeout = 30 * time.Second
DefaultPolicy = "passthrough"
DefaultPolicyTimeout = 30 * time.Second
DefaultActionTimeout = 30 * time.Second
DefaultActionRedisEnabled = false
DefaultRedisAddress = "localhost:6379"
DefaultRedisChannel = "gatewayd-actions"
)

0 comments on commit 258a775

Please sign in to comment.