Documentation
¶
Overview ¶
Package waflog encapsulates getting logs from a WAF to compare with expected results
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FTWLogLines ¶
type FTWLogLines struct {
FileName string
StartMarker []byte
EndMarker []byte
// contains filtered or unexported fields
}
FTWLogLines represents the filename to search for logs in a certain timespan
func NewFTWLogLines ¶
func NewFTWLogLines(opts ...FTWLogOption) (*FTWLogLines, error)
NewFTWLogLines is the base struct for reading the log file
func (*FTWLogLines) CheckLogForMarker ¶
func (ll *FTWLogLines) CheckLogForMarker(stageID string, readLimit int) []byte
CheckLogForMarker reads the log file and searches for a marker line. stageID is the ID of the current stage, which is part of the marker line readLimit is the maximum numbers of lines to check
func (*FTWLogLines) Contains ¶
func (ll *FTWLogLines) Contains(match string) bool
Contains looks in logfile for regex
type FTWLogOption ¶
type FTWLogOption func(*FTWLogLines)
FTWLogOption follows the option pattern for FTWLogLines
func WithEndMarker ¶
func WithEndMarker(marker []byte) FTWLogOption
WithEndMarker sets the end marker for the log file
func WithLogFile ¶
func WithLogFile(fileName string) FTWLogOption
WithLogFile sets the log file to read
func WithStartMarker ¶
func WithStartMarker(marker []byte) FTWLogOption
WithStartMarker sets the start marker for the log file