diff options
author | Valery Piashchynski <[email protected]> | 2020-12-25 14:46:01 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-25 14:46:01 +0300 |
commit | 8526c03822e724bc2ebb64b6197085fea335b782 (patch) | |
tree | b205b392b3721606fae4fa3174327259b41bc76a /pkg/plugins/server/config.go | |
parent | 42b33b77793789d666451798b07587f6404242b4 (diff) |
Move root plugins to the pkg
Diffstat (limited to 'pkg/plugins/server/config.go')
-rw-r--r-- | pkg/plugins/server/config.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/pkg/plugins/server/config.go b/pkg/plugins/server/config.go new file mode 100644 index 00000000..4bef3c5f --- /dev/null +++ b/pkg/plugins/server/config.go @@ -0,0 +1,39 @@ +package server + +import ( + "time" +) + +// Config config combines factory, pool and cmd configurations. +type Config struct { + // Command to run as application. + Command string + + // User to run application under. + User string + + // Group to run application under. + Group string + + // Env represents application environment. + Env Env + + // Listen defines connection method and factory to be used to connect to workers: + // "pipes", "tcp://:6001", "unix://rr.sock" + // This config section must not change on re-configuration. + Relay string + + // RelayTimeout defines for how long socket factory will be waiting for worker connection. This config section + // must not change on re-configuration. Defaults to 60s. + RelayTimeout time.Duration +} + +func (cfg *Config) InitDefaults() { + if cfg.Relay == "" { + cfg.Relay = "pipes" + } + + if cfg.RelayTimeout == 0 { + cfg.RelayTimeout = time.Second * 60 + } +} |