producer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunLocalCommand added in v0.2.0

func RunLocalCommand(command string, arg ...string) (string, string, error)

RunLocalCommand run local system command

Types

type MeteringCommandDetails added in v0.3.0

type MeteringCommandDetails struct {
	Command string
	JSON    bool
}

MeteringCommandDetails holds command details that is used to gather a specific field

type MeteringEventBufferedProcessor added in v0.3.0

type MeteringEventBufferedProcessor struct {
	ProcessorCommand string
	BatchContext     *processor.BatchContext
}

MeteringEventBufferedProcessor holds buffer and data processor for publishing events

type MeteringEventFileLogger added in v0.2.0

type MeteringEventFileLogger struct {
	Enabled    bool
	LogFile    string
	MaxSizeMB  int
	MaxBackups int
	MaxAge     int
	Compress   bool
}

MeteringEventFileLogger holds file logger details

type MeteringEventProducer

type MeteringEventProducer struct {
	EventInerval      int
	Fields            log.Fields
	EventIDField      string
	TimestampField    string
	IDGeneratorFields []string
	FieldCommandPairs map[string]MeteringCommandDetails
	FileLogger        *MeteringEventFileLogger
	BufferedProcessor *MeteringEventBufferedProcessor
}

MeteringEventProducer metering producer type which holds required configuration

func ReadProducerFromConfig

func ReadProducerFromConfig(configFile string) (MeteringEventProducer, error)

ReadProducerFromConfig create producer struct from producer configuration

func (*MeteringEventProducer) HandleError added in v0.3.0

func (p *MeteringEventProducer) HandleError(batchContext *processor.BatchContext, err error)

HandleError handle errors during time based buffer processing (it is not used by this generator)

func (*MeteringEventProducer) Process added in v0.3.0

func (p *MeteringEventProducer) Process(batchContext *processor.BatchContext) error

Process run local process commands on gathered metering events

func (*MeteringEventProducer) Run

func (p *MeteringEventProducer) Run()

Run start metering event producer

type MeteringJSONFormatter

type MeteringJSONFormatter struct {
}

MeteringJSONFormatter type for custom json formatter

func (*MeteringJSONFormatter) Format

func (f *MeteringJSONFormatter) Format(entry *log.Entry) ([]byte, error)

Format json formatter for logrus entries

Jump to

Keyboard shortcuts

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