tailer

package
v0.0.0-...-4b55cb2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorReaderRotate = errors.New("reader must rotate now")
	ErrorNoExisted    = errors.New("file is not existed")
)

Functions

func Date

func Date() int

func DateString

func DateString() string

func FileDate

func FileDate(logName string) string

Types

type ChangeEvent

type ChangeEvent struct {
	FileName string
	IsAdd    bool
}

type Tailer

type Tailer struct {
	FileName    string // file name
	NowFileName string // file name
	NowFileDate int
	Offset      int64
	Lines       uint64

	IsDayChange bool
	// contains filtered or unexported fields
}

Tailer implement reader interface

func NewTailer

func NewTailer(ctx context.Context, file, position string, isChange bool) *Tailer

func (*Tailer) Close

func (ft *Tailer) Close()

func (*Tailer) Name

func (ft *Tailer) Name() string

func (*Tailer) Open

func (ft *Tailer) Open() error

func (*Tailer) Run

func (ft *Tailer) Run(stream chan string) error

func (*Tailer) SetStop

func (ft *Tailer) SetStop(isEnd bool)

Init the changer.

func (*Tailer) Stop

func (ft *Tailer) Stop() bool

Init the changer.

type Watcher

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

func NewWatcher

func NewWatcher(ctx context.Context, root, fileName string) *Watcher

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) WatchFiles

func (w *Watcher) WatchFiles(changes chan ChangeEvent) error

watch directory log files changes

Jump to

Keyboard shortcuts

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