services

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CONF = []byte("conf")
View Source
var CONFERROR = []byte("conferror")
View Source
var ErrTruncated = eerrors.New("file has been truncated")
View Source
var GATHER = []byte("gathermetrics")
View Source
var METRICS = []byte("metrics")
View Source
var NOLISTENER = eerrors.New("no listener")
View Source
var SHUTDOWN = []byte("shutdown")
View Source
var START = []byte("start")
View Source
var STARTED = []byte("started")
View Source
var STARTERROR = []byte("starterror")
View Source
var STOP = []byte("stop")
View Source
var STOPPED = []byte("stopped")

Functions

func AccountingPathOpt

func AccountingPathOpt(path string) func(*PluginCreateOpts)

func CertFilesOpt

func CertFilesOpt(list []string) func(*PluginCreateOpts)

func CertPathsOpt

func CertPathsOpt(list []string) func(*PluginCreateOpts)

func ConfDirOpt

func ConfDirOpt(path string) func(*PluginCreateOpts)

func Configure

func Configure(t base.Types, c conf.BaseConfig) (res conf.BaseConfig)

func ConfigureAndStartService

func ConfigureAndStartService(s base.Provider, c conf.BaseConfig) ([]model.ListenerInfo, error)

func DumpableOpt

func DumpableOpt(dumpable bool) func(*PluginCreateOpts)

func FileDestTmplOpt

func FileDestTmplOpt(path string) func(*PluginCreateOpts)

func Launch

func Launch(ctx context.Context, typ base.Types, opts ...ProviderOpt) (err error)

func LaunchConfProvider

func LaunchConfProvider(ctx context.Context, r kring.Ring, confined bool, logger log15.Logger) (err error)

func MakeFilter

func MakeFilter(globstring string) (tail.FilterFunc, error)

func NewAccountingService

func NewAccountingService(env *base.ProviderEnv) (base.Provider, error)

func NewFilePollingService

func NewFilePollingService(env *base.ProviderEnv) (base.Provider, error)

func NewStoreService

func NewStoreService(env *base.ProviderEnv) (base.Provider, error)

NewStoreService creates a StoreService. The StoreService is responsible to manage the lifecycle of the Store and the Kafka Forwarder that is fed by the Store.

func PollDirectories

func PollDirectories(dirs []string) func(*PluginCreateOpts)

func ProfileOpt

func ProfileOpt(profile bool) func(*PluginCreateOpts)

func ProviderFactory

func ProviderFactory(t base.Types, env *base.ProviderEnv) (base.Provider, error)

func SetBinder

func SetBinder(bindr binder.Client) func(e *base.ProviderEnv)

func SetConfined

func SetConfined(confined bool) func(e *base.ProviderEnv)

func SetLogger

func SetLogger(logger log15.Logger) func(e *base.ProviderEnv)

func SetPipe

func SetPipe(pipe *os.File) func(e *base.ProviderEnv)

func SetProfile

func SetProfile(profile bool) func(e *base.ProviderEnv)

func SetReporter

func SetReporter(reporter *base.Reporter) func(e *base.ProviderEnv)

func SetRing

func SetRing(ring kring.Ring) func(e *base.ProviderEnv)

func StorePathOpt

func StorePathOpt(path string) func(*PluginCreateOpts)

func WConf

func WConf(header []byte, message []byte) (err error)

func Wout

func Wout(header []byte, msg []byte) (err error)

Types

type AccountingService

type AccountingService struct {
	Conf conf.AccountingSourceConfig
	// contains filtered or unexported fields
}

func (*AccountingService) FatalError

func (s *AccountingService) FatalError() chan struct{}

func (*AccountingService) Gather

func (s *AccountingService) Gather() ([]*dto.MetricFamily, error)

func (*AccountingService) SetConf

func (s *AccountingService) SetConf(c conf.BaseConfig)

func (*AccountingService) Shutdown

func (s *AccountingService) Shutdown()

func (*AccountingService) Start

func (s *AccountingService) Start() (infos []model.ListenerInfo, err error)

func (*AccountingService) Stop

func (s *AccountingService) Stop()

func (*AccountingService) Type

func (s *AccountingService) Type() base.Types

type CFactory

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

func ControllerFactory

func ControllerFactory(ring kring.Ring, signKey *memguard.LockedBuffer, stasher *StoreController, registry *consul.Registry, logger log15.Logger) *CFactory

func (*CFactory) New

func (f *CFactory) New(typ base.Types) (*Controller, error)

func (*CFactory) NewStore

func (f *CFactory) NewStore(loggerHandle uintptr) *StoreController

type ConfigurationService

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

func NewConfigurationService

func NewConfigurationService(ring kring.Ring, signKey *memguard.LockedBuffer, childLoggerHandle uintptr, l log15.Logger) (*ConfigurationService, error)

func (*ConfigurationService) Chan

func (c *ConfigurationService) Chan() chan *conf.BaseConfig

func (*ConfigurationService) Reload

func (c *ConfigurationService) Reload() error

func (*ConfigurationService) SetConfDir

func (c *ConfigurationService) SetConfDir(cdir string)

func (*ConfigurationService) SetConsulParams

func (c *ConfigurationService) SetConsulParams(params consul.ConnParams)

func (*ConfigurationService) Start

func (c *ConfigurationService) Start(r kring.Ring) error

func (*ConfigurationService) Stop

func (c *ConfigurationService) Stop() error

func (*ConfigurationService) Type

func (c *ConfigurationService) Type() base.Types

func (*ConfigurationService) W

func (c *ConfigurationService) W(header []byte, message []byte) (err error)

type Controller

type Controller struct {
	ShutdownChan chan struct{}
	StopChan     chan struct{}
	// ExitCode should be read only after ShutdownChan has been closed
	ExitCode int
	// contains filtered or unexported fields
}

Controller launches and controls the various services by distinct processes.

func (*Controller) Create

func (s *Controller) Create(optsfuncs ...func(*PluginCreateOpts)) error

func (*Controller) Gather

func (s *Controller) Gather() (m []*dto.MetricFamily, err error)

Gather asks the controlled plugin to report its metrics

func (*Controller) SetConf

func (s *Controller) SetConf(c conf.BaseConfig)

SetConf gives the current global configuration to the controller. The controller will communicate the configuration to the controlled plugin at next start.

func (*Controller) Shutdown

func (s *Controller) Shutdown(killTimeOut time.Duration) (killed bool)

Shutdown demands that the controlled plugin shutdowns now. After killTimeOut, it kills the plugin.

func (*Controller) Start

func (s *Controller) Start() (infos []model.ListenerInfo, err error)

Start asks the controlled plugin to start the operations.

func (*Controller) Stop

func (s *Controller) Stop() error

Stop kindly asks the controlled plugin to stop activity

func (*Controller) W

func (s *Controller) W(header []byte, message []byte) (err error)

W encodes an writes a message to the controlled plugin via its stdin

type FilePollingService

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

func (*FilePollingService) FatalError

func (s *FilePollingService) FatalError() chan struct{}

func (*FilePollingService) Gather

func (s *FilePollingService) Gather() ([]*dto.MetricFamily, error)

func (*FilePollingService) SetConf

func (s *FilePollingService) SetConf(c conf.BaseConfig)

func (*FilePollingService) Shutdown

func (s *FilePollingService) Shutdown()

func (*FilePollingService) Start

func (s *FilePollingService) Start() (infos []model.ListenerInfo, err error)

func (*FilePollingService) Stop

func (s *FilePollingService) Stop()

func (*FilePollingService) Type

func (s *FilePollingService) Type() base.Types

type PluginCreateOpts

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

type ProviderOpt

type ProviderOpt func(e *base.ProviderEnv)

type StoreController

type StoreController struct {
	*Controller
	// contains filtered or unexported fields
}

StoreController is the specialized controller that takes care of the Store.

func (*StoreController) Shutdown

func (s *StoreController) Shutdown(killTimeOut time.Duration)

Shutdown stops definetely the Store.

func (*StoreController) Start

func (s *StoreController) Start() (infos []model.ListenerInfo, err error)

func (*StoreController) Stash

func (s *StoreController) Stash(m *model.FullMessage) error

Stash sends the given message to the Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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