diff options
author | Valery Piashchynski <[email protected]> | 2021-01-25 14:50:21 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-01-25 14:50:21 +0300 |
commit | bb9e34db0f96295c5c2104262f43a3ab0edbc060 (patch) | |
tree | a9b0b99a36b796fdeaac130c9330de10aa4d5c0e /plugins | |
parent | 709f7223fca5e60793ad9b3192f92a554854d6ee (diff) |
Add new Supervisor test in the http plugin
Uniform supervisor config keys to use same notation as pool (10s, 10h
not just 10)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/http/config/http.go | 2 | ||||
-rw-r--r-- | plugins/http/config/ssl.go | 2 | ||||
-rw-r--r-- | plugins/server/config.go | 89 |
3 files changed, 3 insertions, 90 deletions
diff --git a/plugins/http/config/http.go b/plugins/http/config/http.go index a8b1e8e3..bfbc1af6 100644 --- a/plugins/http/config/http.go +++ b/plugins/http/config/http.go @@ -72,7 +72,7 @@ func (c *HTTP) InitDefaults() error { // default pool c.Pool = &poolImpl.Config{ Debug: false, - NumWorkers: int64(runtime.NumCPU()), + NumWorkers: uint64(runtime.NumCPU()), MaxJobs: 1000, AllocateTimeout: time.Second * 60, DestroyTimeout: time.Second * 60, diff --git a/plugins/http/config/ssl.go b/plugins/http/config/ssl.go index c33dbce4..eb2b72b5 100644 --- a/plugins/http/config/ssl.go +++ b/plugins/http/config/ssl.go @@ -23,7 +23,7 @@ type SSL struct { Cert string // Root CA file - RootCA string + RootCA string `mapstructure:"root_ca"` // internal host string diff --git a/plugins/server/config.go b/plugins/server/config.go index 92e6780a..a4b0d91c 100644 --- a/plugins/server/config.go +++ b/plugins/server/config.go @@ -26,112 +26,25 @@ type Config struct { RelayTimeout time.Duration `mapstructure:"relay_timeout"` } `mapstructure:"server"` + // we just need to know if the section exist, we don't need to read config from it RPC *struct { Listen string `mapstructure:"listen"` } `mapstructure:"rpc"` Logs *struct { - Mode string `mapstructure:"mode"` - Level string `mapstructure:"level"` } `mapstructure:"logs"` HTTP *struct { - Address string `mapstructure:"address"` - MaxRequestSize int `mapstructure:"max_request_size"` - Middleware []string `mapstructure:"middleware"` - Uploads struct { - Forbid []string `mapstructure:"forbid"` - } `mapstructure:"uploads"` - TrustedSubnets []string `mapstructure:"trusted_subnets"` - Pool struct { - NumWorkers int `mapstructure:"num_workers"` - MaxJobs int `mapstructure:"max_jobs"` - AllocateTimeout string `mapstructure:"allocate_timeout"` - DestroyTimeout string `mapstructure:"destroy_timeout"` - Supervisor struct { - WatchTick int `mapstructure:"watch_tick"` - TTL int `mapstructure:"ttl"` - IdleTTL int `mapstructure:"idle_ttl"` - ExecTTL int `mapstructure:"exec_ttl"` - MaxWorkerMemory int `mapstructure:"max_worker_memory"` - } `mapstructure:"supervisor"` - } `mapstructure:"pool"` - Ssl struct { - Port int `mapstructure:"port"` - Redirect bool `mapstructure:"redirect"` - Cert string `mapstructure:"cert"` - Key string `mapstructure:"key"` - } `mapstructure:"ssl"` - Fcgi struct { - Address string `mapstructure:"address"` - } `mapstructure:"fcgi"` - HTTP2 struct { - Enabled bool `mapstructure:"enabled"` - H2C bool `mapstructure:"h2c"` - MaxConcurrentStreams int `mapstructure:"max_concurrent_streams"` - } `mapstructure:"http2"` } `mapstructure:"http"` Redis *struct { - Addrs []string `mapstructure:"addrs"` - MasterName string `mapstructure:"master_name"` - Username string `mapstructure:"username"` - Password string `mapstructure:"password"` - DB int `mapstructure:"db"` - SentinelPassword string `mapstructure:"sentinel_password"` - RouteByLatency bool `mapstructure:"route_by_latency"` - RouteRandomly bool `mapstructure:"route_randomly"` - DialTimeout int `mapstructure:"dial_timeout"` - MaxRetries int `mapstructure:"max_retries"` - MinRetryBackoff int `mapstructure:"min_retry_backoff"` - MaxRetryBackoff int `mapstructure:"max_retry_backoff"` - PoolSize int `mapstructure:"pool_size"` - MinIdleConns int `mapstructure:"min_idle_conns"` - MaxConnAge int `mapstructure:"max_conn_age"` - ReadTimeout int `mapstructure:"read_timeout"` - WriteTimeout int `mapstructure:"write_timeout"` - PoolTimeout int `mapstructure:"pool_timeout"` - IdleTimeout int `mapstructure:"idle_timeout"` - IdleCheckFreq int `mapstructure:"idle_check_freq"` - ReadOnly bool `mapstructure:"read_only"` } `mapstructure:"redis"` Boltdb *struct { - Dir string `mapstructure:"dir"` - File string `mapstructure:"file"` - Bucket string `mapstructure:"bucket"` - Permissions int `mapstructure:"permissions"` - TTL int `mapstructure:"TTL"` } `mapstructure:"boltdb"` Memcached *struct { - Addr []string `mapstructure:"addr"` } `mapstructure:"memcached"` Memory *struct { - Enabled bool `mapstructure:"enabled"` - Interval int `mapstructure:"interval"` } `mapstructure:"memory"` Metrics *struct { - Address string `mapstructure:"address"` - Collect struct { - AppMetric struct { - Type string `mapstructure:"type"` - Help string `mapstructure:"help"` - Labels []string `mapstructure:"labels"` - Buckets []float64 `mapstructure:"buckets"` - Objectives []struct { - Num2 float64 `mapstructure:"2,omitempty"` - One4 float64 `mapstructure:"1.4,omitempty"` - } `mapstructure:"objectives"` - } `mapstructure:"app_metric"` - } `mapstructure:"collect"` } `mapstructure:"metrics"` Reload *struct { - Interval string `mapstructure:"interval"` - Patterns []string `mapstructure:"patterns"` - Services struct { - HTTP struct { - Recursive bool `mapstructure:"recursive"` - Ignore []string `mapstructure:"ignore"` - Patterns []string `mapstructure:"patterns"` - Dirs []string `mapstructure:"dirs"` - } `mapstructure:"http"` - } `mapstructure:"services"` } `mapstructure:"reload"` } |