Documentation ¶
Index ¶
- Constants
- type Config
- type OnInitConfig
- type Plugin
- func (p *Plugin) CmdFactory(env map[string]string) func() *exec.Cmd
- func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger) error
- func (p *Plugin) Name() string
- func (p *Plugin) NewWorker(ctx context.Context, env map[string]string) (worker.BaseProcess, error)
- func (p *Plugin) NewWorkerPool(ctx context.Context, cfg interface{}, env map[string]string, _ *zap.Logger) (pool.Pool, error)
- func (p *Plugin) Serve() chan error
- func (p *Plugin) Stop() error
- func (p *Plugin) Write(data []byte) (int, error)
- type RPCConfig
Constants ¶
View Source
const ( // PluginName for the server PluginName string = "server" // RPCPluginName is the name of the RPC plugin, should be in sync with rpc/config.go RPCPluginName string = "rpc" // RrRelay env variable key (internal) RrRelay string = "RR_RELAY" // RrRPC env variable key (internal) if the RPC presents RrRPC string = "RR_RPC" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // OnInit configuration OnInit *OnInitConfig `mapstructure:"on_init"` // Command to run as application. Command string `mapstructure:"command"` // User to run application under. User string `mapstructure:"user"` // Group to run application under. Group string `mapstructure:"group"` // Env represents application environment. Env map[string]string `mapstructure:"env"` // Relay 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 `mapstructure:"relay"` // 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 `mapstructure:"relay_timeout"` }
Config All config (.rr.yaml) For other section use pointer to distinguish between `empty` and `not present`
func (*Config) InitDefaults ¶
InitDefaults for the server config
type OnInitConfig ¶
type OnInitConfig struct { // Command which is started before worker starts Command string `mapstructure:"command"` // ExecTimeout is execute timeout for the command ExecTimeout time.Duration `mapstructure:"exec_timeout"` // Env represents application environment. Env map[string]string `mapstructure:"env"` }
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin manages worker
func (*Plugin) CmdFactory ¶
CmdFactory provides worker command factory associated with given context
func (*Plugin) NewWorkerPool ¶
func (p *Plugin) NewWorkerPool(ctx context.Context, cfg interface{}, env map[string]string, _ *zap.Logger) (pool.Pool, error)
NewWorkerPool issues new worker pool.
Click to show internal directories.
Click to hide internal directories.