grep

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidIP     = errors.New("invalid client IP")
	ErrNoPrefixMatch = errors.New("no matching prefix")
	ErrURLNoMatch    = errors.New("URL does not match")
	ErrTimeNoMatch   = errors.New("time does not match")
	ErrSizeTooSmall  = errors.New("size below threshold")
	ErrServerNoMatch = errors.New("server does not match")
)

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Prefixes    []netip.Prefix
	UrlContains []string
	TimeFrom    time.Time
	TimeTo      time.Time
	Threshold   util.SizeFlag
	Server      string
}

func (*Filter) InstallFlags

func (f *Filter) InstallFlags(flags *pflag.FlagSet)

func (*Filter) IsEmpty

func (f *Filter) IsEmpty() bool

func (*Filter) Match

func (f *Filter) Match(item parser.LogItem) error

type Grepper

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

func New

func New(c GrepperConfig, w io.Writer) (*Grepper, error)

func (*Grepper) GrepFile

func (g *Grepper) GrepFile(filename string) error

func (*Grepper) IsEmpty

func (g *Grepper) IsEmpty() bool

func (*Grepper) RunLoop

func (g *Grepper) RunLoop(iter fileiter.Iterator) error

type GrepperConfig

type GrepperConfig struct {
	Parser string
	Output string
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() GrepperConfig

func (*GrepperConfig) InstallFlags

func (c *GrepperConfig) InstallFlags(flags *pflag.FlagSet)

Jump to

Keyboard shortcuts

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