filesystem

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageReader

type MessageReader struct {
	*tail.Tail
	// contains filtered or unexported fields
}

MessageReader is used to tail a file path and create log data from the lines.

func (*MessageReader) MessageRead

func (fs *MessageReader) MessageRead(ctx context.Context) (*logspray.Message, error)

MessageRead implements the LogSourcer interface

func (*MessageReader) MessageWriteTo

func (fs *MessageReader) MessageWriteTo(ctx context.Context, tm *logspray.Message) error

MessageWriteTo implements the LogSourcer interface

type Watcher

type Watcher struct {
	Path       string
	NameRegexp *regexp.Regexp
	Recur      bool //recur into directories
	// contains filtered or unexported fields
}

Watcher watches for files being added and removed from a filesystem

func New

func New(Path string, NameRegexp *regexp.Regexp, Recur bool) *Watcher

New creates a new filesystem log source

func (*Watcher) Next

func (fs *Watcher) Next(ctx context.Context) ([]*sources.Update, error)

Next should be called each time you wish to watch for an update.

func (*Watcher) ReadTarget

func (*Watcher) ReadTarget(ctx context.Context, fn string, fromStart bool) (sources.MessageReader, error)

func (*Watcher) String

func (fs *Watcher) String() string

Jump to

Keyboard shortcuts

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