chore: add redis config
This commit is contained in:
@@ -36,6 +36,8 @@ type Server struct {
|
|||||||
IdleTimeout int `json:"idleTimeout,omitempty" yaml:"idleTimeout,omitempty"`
|
IdleTimeout int `json:"idleTimeout,omitempty" yaml:"idleTimeout,omitempty"`
|
||||||
// LogLevel log level, info, debug, trace, off
|
// LogLevel log level, info, debug, trace, off
|
||||||
LogLevel string `json:"logLevel,omitempty" yaml:"logLevel,omitempty"`
|
LogLevel string `json:"logLevel,omitempty" yaml:"logLevel,omitempty"`
|
||||||
|
// Redis contains redis database details
|
||||||
|
Redis Redis `json:"redis,omitempty" yaml:"redis,omitempty"`
|
||||||
// Cors holds proxy global cors
|
// Cors holds proxy global cors
|
||||||
Cors Cors `json:"cors,omitempty" yaml:"cors,omitempty,omitempty"`
|
Cors Cors `json:"cors,omitempty" yaml:"cors,omitempty,omitempty"`
|
||||||
// InterceptErrors holds the status codes to intercept the error from backend
|
// InterceptErrors holds the status codes to intercept the error from backend
|
||||||
@@ -85,3 +87,8 @@ type RouteHealthCheck struct {
|
|||||||
Timeout string `json:"timeout,omitempty" yaml:"timeout"`
|
Timeout string `json:"timeout,omitempty" yaml:"timeout"`
|
||||||
HealthyStatuses []int `json:"healthyStatuses,omitempty" yaml:"healthyStatuses"`
|
HealthyStatuses []int `json:"healthyStatuses,omitempty" yaml:"healthyStatuses"`
|
||||||
}
|
}
|
||||||
|
type Redis struct {
|
||||||
|
// Addr redis hostname and port number :
|
||||||
|
Addr string `json:"addr,omitempty" yaml:"addr,omitempty"`
|
||||||
|
Password string `json:"password,omitempty" yaml:"password,omitempty"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ type Gateway struct {
|
|||||||
// SSLKeyFile SSL Private key file
|
// SSLKeyFile SSL Private key file
|
||||||
SSLKeyFile string `yaml:"sslKeyFile"`
|
SSLKeyFile string `yaml:"sslKeyFile"`
|
||||||
// Redis contains redis database details
|
// Redis contains redis database details
|
||||||
Redis Redis `yaml:"redis"`
|
Redis gomaprojv1beta1.Redis `yaml:"redis"`
|
||||||
// WriteTimeout defines proxy write timeout
|
// WriteTimeout defines proxy write timeout
|
||||||
WriteTimeout int `yaml:"writeTimeout"`
|
WriteTimeout int `yaml:"writeTimeout"`
|
||||||
// ReadTimeout defines proxy read timeout
|
// ReadTimeout defines proxy read timeout
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ func mapToGateway(g gomaprojv1beta1.GatewaySpec) Gateway {
|
|||||||
return Gateway{
|
return Gateway{
|
||||||
SSLKeyFile: "",
|
SSLKeyFile: "",
|
||||||
SSLCertFile: "",
|
SSLCertFile: "",
|
||||||
Redis: Redis{},
|
Redis: g.Server.Redis,
|
||||||
WriteTimeout: g.Server.WriteTimeout,
|
WriteTimeout: g.Server.WriteTimeout,
|
||||||
ReadTimeout: g.Server.ReadTimeout,
|
ReadTimeout: g.Server.ReadTimeout,
|
||||||
IdleTimeout: g.Server.IdleTimeout,
|
IdleTimeout: g.Server.IdleTimeout,
|
||||||
|
|||||||
Reference in New Issue
Block a user