Documentation
¶
Index ¶
- Variables
- func FileReader(filePath string, processFunc LineProcessor) error
- func ValidateStruct(requestObject interface{}) error
- type Config
- type ErrorHandler
- type Input
- type InputHandler
- type LineProcessor
- type LoadStateFunc
- type Logger
- type Output
- type OutputHandler
- type PipelineResults
- type PluginConfig
- type ProcessHandler
- type Processor
- type RotateWriter
- type SaveStateFunc
- type State
- type TmpWriter
- func (l *TmpWriter) Close() error
- func (l *TmpWriter) CurrentFile() *os.File
- func (l *TmpWriter) DeleteCurrentFile() (err error)
- func (l *TmpWriter) DeletePreviousFile() (err error)
- func (l *TmpWriter) Exit() (err error)
- func (l *TmpWriter) PreviousCount() int
- func (l *TmpWriter) PreviousFile() *os.File
- func (l *TmpWriter) Rotate() (int, string, error)
- func (l *TmpWriter) Size() int64
- func (l *TmpWriter) Write(p []byte) (n int, err error)
- func (l *TmpWriter) WriteString(s string) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var MaxLogSize = 5 * 1024 * 1024
MaxLogSize specifies the max size for a log (in this case 5MB) we do this because some of our output plugins have a limit on per entry size.
Max size per log = 5MB
Functions ¶
func FileReader ¶
func FileReader(filePath string, processFunc LineProcessor) error
func ValidateStruct ¶
func ValidateStruct(requestObject interface{}) error
Types ¶
type Config ¶
type Config struct {
Input PluginConfig `json:"input" yaml:"input"`
Processors []PluginConfig `json:"processors" yaml:"processors"`
Outputs []PluginConfig `json:"outputs" yaml:"outputs"`
}
type ErrorHandler ¶
type Input ¶
type Input interface {
Run(errorHandler ErrorHandler, state State, processPipe chan<- PipelineResults)
Stop()
}
type InputHandler ¶
type LineProcessor ¶
type LineProcessor func(string)
type LoadStateFunc ¶
type Logger ¶
type Logger interface {
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Panicf(format string, args ...interface{})
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
Fatal(args ...interface{})
Panic(args ...interface{})
Debugln(args ...interface{})
Infoln(args ...interface{})
Warnln(args ...interface{})
Errorln(args ...interface{})
Fatalln(args ...interface{})
Panicln(args ...interface{})
}
type OutputHandler ¶
type PipelineResults ¶
type PluginConfig ¶
type PluginConfig struct {
Name string `json:"name" yaml:"name"`
Settings json.RawMessage `json:"settings,omitempty" yaml:"settings,omitempty"`
}
type ProcessHandler ¶
type RotateWriter ¶ added in v0.3.0
type RotateWriter struct {
// contains filtered or unexported fields
}
func NewRotateWriter ¶ added in v0.3.0
func NewRotateWriter(filename string, maxSize int64) (*RotateWriter, error)
NewRotateWriter creates a new RotateWriter. Return nil if error occurs during setup.
func (*RotateWriter) Close ¶ added in v0.3.0
func (w *RotateWriter) Close() error
Close implements io.Closer, and closes the current logfile.
func (*RotateWriter) Write ¶ added in v0.3.0
func (w *RotateWriter) Write(p []byte) (n int, err error)
Write implements io.Writer.
func (*RotateWriter) WriteString ¶ added in v0.3.0
func (w *RotateWriter) WriteString(s string) (n int, err error)
type SaveStateFunc ¶
type TmpWriter ¶
type TmpWriter struct {
WriteCount int
// contains filtered or unexported fields
}
func NewTmpWriter ¶
func (*TmpWriter) CurrentFile ¶
CurrentFile returns current log file pointer
func (*TmpWriter) DeleteCurrentFile ¶
DeleteCurrentFile deletes the current log file and update struct
func (*TmpWriter) DeletePreviousFile ¶
DeletePreviousFile deletes the previous log file and update struct
func (*TmpWriter) PreviousCount ¶
PreviousCount returns previous file write count
func (*TmpWriter) PreviousFile ¶
PreviousFile returns previous log file pointer
func (*TmpWriter) Rotate ¶
Rotate causes TmpWriter to close the existing log file and immediately create a new one.