waflog

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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

NewFTWLogLines is the base struct for reading the log file

func (*FTWLogLines) CheckLogForMarker

func (ll *FTWLogLines) CheckLogForMarker(stageID string) []byte

CheckLogForMarker reads the log file and searches for a marker line. logFile is the file to search stageID is the ID of the current stage, which is part of the marker line

func (*FTWLogLines) Cleanup

func (ll *FTWLogLines) Cleanup() error

Cleanup closes the log file

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

Jump to

Keyboard shortcuts

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