sources

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 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 LogReader

type LogReader struct {
	Path            string
	Glob            bool
	TimestampRegex  *regexp.Regexp
	TimestampLayout string
	// contains filtered or unexported fields
}

LogReader is a base Source helper that can Read file contents, cache, and support Glob file paths Other Sources can be built on-top of the LogSrc

func (*LogReader) ClearCache

func (l *LogReader) ClearCache()

ClearCache cleas the cached log

func (*LogReader) Find

func (l *LogReader) Find(re *regexp.Regexp, firstOccurrence bool) (time.Time, error)

Find searches for the passed in regexp from the log references in the LogReader

func (*LogReader) Read

func (l *LogReader) Read() ([]byte, error)

Read will open and read all the bytes of a log file into byte slice and then cache it Any further calls to Read() will use the cached byte slice. If the file is being updated and you need the updated contents, you'll need to instantiate a new LogSrc and call Read() again

type Source

type Source interface {
	// Find finds the string in the source using a source specific method (could be regex or HTTP path)
	// If no time.Time could be found an error is returned
	Find(search string, firstOccurrence bool) (time.Time, error)
	// Name is the source name identifier
	Name() string
	// ClearCache clears any cached source data
	ClearCache()
	// String is a human friendly version of the source, usually the log filepath
	String() string
}

Source ius

Directories

Path Synopsis
Package awsnode is a latency timing source for the VPC CNI logs (aka aws-node DaemonSet)
Package awsnode is a latency timing source for the VPC CNI logs (aka aws-node DaemonSet)
Package imds is a latency timing source for the EC2 Instance Metadata Service (IMDS)
Package imds is a latency timing source for the EC2 Instance Metadata Service (IMDS)
Package messages is a latency timing source for /var/log/messages
Package messages is a latency timing source for /var/log/messages

Jump to

Keyboard shortcuts

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