in_tail

package
v0.0.0-...-ab997d7 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2015 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory() plugin.Plugin

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 TailInput

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

func (*TailInput) Close

func (i *TailInput) Close() error

func (*TailInput) Init

func (i *TailInput) Init(env *plugin.Env) (err error)

func (*TailInput) Start

func (i *TailInput) Start() (err error)

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

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) Scan

func (w *Watcher) Scan() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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