@@ -86,7 +86,7 @@ It's designed to be straightforward and efficient, offering a rich set of featur
|
||||
Use a round-robin algorithm for efficient load distribution.
|
||||
|
||||
### Configuration and Flexibility
|
||||
- **Support for Multiple Route Configuration Files**
|
||||
- **Support for Multiple Route and Middleware Configuration Files**
|
||||
Organize routes across multiple `.yml` or `.yaml` files.
|
||||
|
||||
- **TLS Support**
|
||||
|
||||
@@ -133,23 +133,9 @@ func initConfig(configFile string) error {
|
||||
conf := &GatewayConfig{
|
||||
Version: util.ConfigVersion,
|
||||
GatewayConfig: Gateway{
|
||||
WriteTimeout: 15,
|
||||
ReadTimeout: 15,
|
||||
IdleTimeout: 30,
|
||||
AccessLog: "/dev/Stdout",
|
||||
ErrorLog: "/dev/stderr",
|
||||
DisableRouteHealthCheckError: false,
|
||||
DisableDisplayRouteOnStart: false,
|
||||
RateLimit: 0,
|
||||
InterceptErrors: []int{405, 500},
|
||||
Cors: Cors{
|
||||
Origins: []string{"http://localhost:8080", "https://example.com"},
|
||||
Headers: map[string]string{
|
||||
"Access-Control-Allow-Headers": "Origin, Authorization, Accept, Content-Type, Access-Control-Allow-Headers",
|
||||
"Access-Control-Allow-Credentials": "true",
|
||||
"Access-Control-Max-Age": "1728000",
|
||||
},
|
||||
},
|
||||
WriteTimeout: 15,
|
||||
ReadTimeout: 15,
|
||||
IdleTimeout: 30,
|
||||
Routes: []Route{
|
||||
{
|
||||
Name: "Example",
|
||||
|
||||
@@ -32,26 +32,26 @@ type Gateway struct {
|
||||
// IdleTimeout defines proxy idle timeout
|
||||
IdleTimeout int `yaml:"idleTimeout" env:"GOMA_IDLE_TIMEOUT, overwrite"`
|
||||
// RateLimit Defines the number of request peer minutes
|
||||
RateLimit int `yaml:"rateLimit" env:"GOMA_RATE_LIMIT, overwrite"`
|
||||
RateLimit int `yaml:"rateLimit,omitempty" env:"GOMA_RATE_LIMIT, overwrite"`
|
||||
// BlockCommonExploits enable, disable block common exploits
|
||||
BlockCommonExploits bool `yaml:"blockCommonExploits"`
|
||||
AccessLog string `yaml:"accessLog" env:"GOMA_ACCESS_LOG, overwrite"`
|
||||
ErrorLog string `yaml:"errorLog" env:"GOMA_ERROR_LOG=, overwrite"`
|
||||
BlockCommonExploits bool `yaml:"blockCommonExploits,omitempty"`
|
||||
AccessLog string `yaml:"accessLog,omitempty" env:"GOMA_ACCESS_LOG, overwrite"`
|
||||
ErrorLog string `yaml:"errorLog,omitempty" env:"GOMA_ERROR_LOG=, overwrite"`
|
||||
LogLevel string `yaml:"logLevel" env:"GOMA_LOG_LEVEL, overwrite"`
|
||||
|
||||
// DisableHealthCheckStatus enable and disable routes health check
|
||||
DisableHealthCheckStatus bool `yaml:"disableHealthCheckStatus"`
|
||||
// DisableRouteHealthCheckError allows enabling and disabling backend healthcheck errors
|
||||
DisableRouteHealthCheckError bool `yaml:"disableRouteHealthCheckError"`
|
||||
DisableRouteHealthCheckError bool `yaml:"disableRouteHealthCheckError,omitempty"`
|
||||
// Disable allows enabling and disabling displaying routes on start
|
||||
DisableDisplayRouteOnStart bool `yaml:"disableDisplayRouteOnStart"`
|
||||
DisableDisplayRouteOnStart bool `yaml:"disableDisplayRouteOnStart,omitempty"`
|
||||
// DisableKeepAlive allows enabling and disabling KeepALive server
|
||||
DisableKeepAlive bool `yaml:"disableKeepAlive"`
|
||||
DisableKeepAlive bool `yaml:"disableKeepAlive,omitempty"`
|
||||
EnableMetrics bool `yaml:"enableMetrics"`
|
||||
// InterceptErrors holds the status codes to intercept the error from backend
|
||||
InterceptErrors []int `yaml:"interceptErrors"`
|
||||
InterceptErrors []int `yaml:"interceptErrors,omitempty"`
|
||||
// Cors holds proxy global cors
|
||||
Cors Cors `yaml:"cors"`
|
||||
Cors Cors `yaml:"cors,omitempty"`
|
||||
// ExtraRoutes additional routes from defined directory
|
||||
ExtraRoutes ExtraRouteConfig `yaml:"extraRoutes"`
|
||||
// Routes holds proxy routes
|
||||
|
||||
Reference in New Issue
Block a user