Documentation ¶
Index ¶
Constants ¶
View Source
const ( StrategyFieldName = "buffer.strategy" MemoryBufferStrategy = "memory" FileBufferStrategy = "file" CombinationBufferStrategy = "combination" StrategyDefault = CombinationBufferStrategy )
Variables ¶
View Source
var Component = &app.Component{ Dependencies: app.Components{ configurator.Component, runner.Component, file.Component, memory.Component, memory2.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provides( NewConfig, NewWithConfigurator, func(buffer *Process) Buffer { return buffer }, ) }), BindFlags: app.BindFlags(func(flagSet *pflag.FlagSet, container container.Container) error { return container.Invoke(func(config *Config) { flagSet.StringVar(&config.Strategy, StrategyFieldName, StrategyDefault, fmt.Sprintf( "storage strategy. Available strategies: "+ "%s - saves data only in the application's memory; "+ "%s - saves data only to a file; "+ "%s - saves data in the application's memory, when the memory is full, saves the data to a file.", MemoryBufferStrategy, FileBufferStrategy, CombinationBufferStrategy, )) }) }), Run: app.Run(func(container container.Container) error { return container.Invoke(func(runner runner.Runner, buffer *Process) error { return runner.AddProcesses(buffer) }) }), }
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer io.ReadWriteCloser
type Config ¶
func Configuration ¶
func Configuration(config *Config, configurator configurator.Configurator) *Config
type Process ¶ added in v1.8.12
type Process struct { Buffer // contains filtered or unexported fields }
func NewProcess ¶ added in v1.8.12
func NewWithConfigurator ¶
func NewWithConfigurator(config *Config, configurator configurator.Configurator, informer logger.Informer, container container.Container) (*Process, error)
Click to show internal directories.
Click to hide internal directories.