fs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatFile

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

CatFile is for reading a whole file.

func NewCatFile

func NewCatFile(filePath string, globID string, serverMessages chan<- string, limiter chan struct{}) CatFile

NewCatFile returns a new file catter.

func (CatFile) FilePath

func (f CatFile) FilePath() string

FilePath returns the full file path.

func (CatFile) Retry

func (f CatFile) Retry() bool

Retry reading the file on error?

func (CatFile) Start

func (f CatFile) Start(lines chan<- LineRead, regex string) error

Start tailing a log file.

func (CatFile) Stop

func (f CatFile) Stop()

Stop reading file.

type FileReader

type FileReader interface {
	Start(lines chan<- LineRead, regex string) error
	FilePath() string
	Retry() bool
	Stop()
}

FileReader is the interface used on the dtail server to read/cat/grep/mapr... a file.

type LineRead

type LineRead struct {
	// The content of the log line.
	Content []byte
	// Until now, how many log lines were processed?
	Count uint64
	// Sometimes we produce too many log lines so that the client
	// is too slow to process all of them. The server will drop log
	// lines if that happens but it will signal to the client how
	// many log lines in % could be transmitted to the client.
	TransmittedPerc int
	GlobID          *string
}

LineRead represents a read log line.

func (LineRead) String

func (l LineRead) String() string

Return a human readable representation of the followed line.

type TailFile

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

TailFile is to tail and filter a log file.

func NewTailFile

func NewTailFile(filePath string, globID string, serverMessages chan<- string, limiter chan struct{}) TailFile

NewTailFile returns a new file tailer.

func (TailFile) FilePath

func (f TailFile) FilePath() string

FilePath returns the full file path.

func (TailFile) Retry

func (f TailFile) Retry() bool

Retry reading the file on error?

func (TailFile) Start

func (f TailFile) Start(lines chan<- LineRead, regex string) error

Start tailing a log file.

func (TailFile) Stop

func (f TailFile) Stop()

Stop reading file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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