diff options
author | Wolfy-J <[email protected]> | 2018-06-10 16:44:41 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-10 16:44:41 +0300 |
commit | 4c292ee46f5505b00b16186e8f30e9bc1be25895 (patch) | |
tree | 818dffc7ce5e890875b147b97e298d4c7c48cbd9 /service/http/config.go | |
parent | a62237fa5afc310453e709837e363f0bb4d7ecf3 (diff) |
fs config
Diffstat (limited to 'service/http/config.go')
-rw-r--r-- | service/http/config.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/service/http/config.go b/service/http/config.go new file mode 100644 index 00000000..b828eb08 --- /dev/null +++ b/service/http/config.go @@ -0,0 +1,34 @@ +package http + +import ( + "github.com/spiral/roadrunner" + "fmt" +) + +// Configures RoadRunner HTTP server. +type Config struct { + // Enable enables http service. + Enable bool + + // Host and port to handle as http server. + Host, Port string + + // MaxRequest specified max size for payload body in bytes, set 0 to unlimited. + MaxRequest int64 + + // Uploads configures uploads configuration. + Uploads *FsConfig + + // Workers configures roadrunner server and worker pool. + Workers *roadrunner.ServerConfig +} + +// Valid validates the configuration. +func (cfg *Config) Valid() error { + return nil +} + +// httpAddr returns prepared http listen address. +func (cfg *Config) httpAddr() string { + return fmt.Sprintf("%s:%v", cfg.Host, cfg.Port) +} |