multitail

package module
v0.0.0-...-0b6acc4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 7 Imported by: 0

README

go-multitail

go-multitail is a Go package to continuously consume lines from multiple files similar to tail -f.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ReadFromHead bool
}

type Line

type Line struct {
	Filename string    // The name of the file from which this line originates
	Text     string    // The contents of the file
	Num      int       // The line number
	SeekInfo SeekInfo  // SeekInfo
	Time     time.Time // Present time
	Err      error     // Error from tail
}

type MultiTail

type MultiTail struct {
	Lines chan *Line
	Config
}

func OpenDirectory

func OpenDirectory(path string, config Config) (*MultiTail, error)

OpenDirectory returns a Multitail for all files in the specified directory path

func OpenGlob

func OpenGlob(glob string, config Config) (*MultiTail, error)

OpenGlob returns a Multitail for all files matching a specified glob pattern. See filepath.Glob for glob pattern syntax.

type SeekInfo

type SeekInfo struct {
	Offset int64
	Whence int
}

Jump to

Keyboard shortcuts

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