daemon

package
v0.0.0-...-4097794 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2017 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCollectorActions

func HandleCollectorActions(actions []graylog.ResponseCollectorAction)

func RegisterBackendRunner

func RegisterBackendRunner(name string, c RunnerCreator) error

Types

type DaemonConfig

type DaemonConfig struct {
	Name        string
	DisplayName string
	Description string

	Dir string
	Env []string

	Runner map[string]Runner
}
var (
	Daemon *DaemonConfig
)

func NewConfig

func NewConfig() *DaemonConfig

func (*DaemonConfig) AddBackend

func (dc *DaemonConfig) AddBackend(backend backends.Backend, context *context.Ctx)

func (*DaemonConfig) NewDistributor

func (dc *DaemonConfig) NewDistributor() *Distributor

type Distributor

type Distributor struct {
	Running bool
	// contains filtered or unexported fields
}

func (*Distributor) BindToService

func (dist *Distributor) BindToService(s service.Service)

func (*Distributor) Start

func (dist *Distributor) Start(s service.Service) error

start all backend runner, don't block

func (*Distributor) Stop

func (dist *Distributor) Stop(s service.Service) error

stop all backend runner parallel and wait till they are finished

type ExecRunner

type ExecRunner struct {
	RunnerCommon
	// contains filtered or unexported fields
}

func (*ExecRunner) Name

func (r *ExecRunner) Name() string

func (*ExecRunner) Restart

func (r *ExecRunner) Restart() error

func (*ExecRunner) Running

func (r *ExecRunner) Running() bool

func (*ExecRunner) SetDaemon

func (r *ExecRunner) SetDaemon(d *DaemonConfig)

func (*ExecRunner) Shutdown

func (r *ExecRunner) Shutdown() error

func (*ExecRunner) Supervised

func (r *ExecRunner) Supervised() bool

func (*ExecRunner) ValidateBeforeStart

func (r *ExecRunner) ValidateBeforeStart() error

type Runner

type Runner interface {
	Name() string
	Running() bool
	ValidateBeforeStart() error
	Restart() error
	Shutdown() error
	SetDaemon(*DaemonConfig)
}

func NewExecRunner

func NewExecRunner(backend backends.Backend, context *context.Ctx) Runner

type RunnerCommon

type RunnerCommon struct {
	// contains filtered or unexported fields
}

type RunnerCreator

type RunnerCreator func(backends.Backend, *context.Ctx) Runner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL