Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Tag string `toml:"tag"` Path string `toml:"path"` PosFile string `toml:"pos_file"` Format string `toml:"format"` TimeKey string `toml:"time_key"` TimeFormat string `toml:"time_format"` TimeZone string `toml:"timezone"` RecordKey string `toml:"record_key"` RecordFormat string `toml:"record_format"` ReadFromHead bool `toml:"read_from_head"` }
type LineParser ¶
type LineParser struct {
// contains filtered or unexported fields
}
type PositionEntry ¶
type PositionEntry struct { Offset int64 Path string Pos int64 Ino uint64 ReadFromHead bool // contains filtered or unexported fields }
func (*PositionEntry) IsRotated ¶
func (p *PositionEntry) IsRotated() (rotated, truncated bool)
func (*PositionEntry) Refresh ¶
func (p *PositionEntry) Refresh() int64
func (*PositionEntry) Set ¶
func (p *PositionEntry) Set(pos int64, ino uint64)
func (*PositionEntry) SetPos ¶
func (p *PositionEntry) SetPos(pos int64)
type PositionFile ¶
type PositionFile struct {
// contains filtered or unexported fields
}
func NewPositionFile ¶
func NewPositionFile(path string) (*PositionFile, error)
func (*PositionFile) Close ¶
func (p *PositionFile) Close() error
func (*PositionFile) Get ¶
func (p *PositionFile) Get(path string) *PositionEntry
type PositionReader ¶
type PositionReader struct {
// contains filtered or unexported fields
}
func NewPositionReader ¶
func NewPositionReader(pe *PositionEntry) (*PositionReader, error)
func (*PositionReader) Close ¶
func (r *PositionReader) Close() error
func (*PositionReader) ReadLine ¶
func (r *PositionReader) ReadLine() ([]byte, error)
ReadLine tries to return a single line, not including the end-of-line bytes. It also skip empty line.
type TailHandler ¶
type TailHandler func([]byte)
type Watcher ¶
type Watcher struct { FSEventC chan fsnotify.Event // contains filtered or unexported fields }
func NewWatcher ¶
func NewWatcher(pe *PositionEntry, env *plugin.Env, h TailHandler, fsw *fsnotify.Watcher) *Watcher
Click to show internal directories.
Click to hide internal directories.