testhelpers

package
v0.0.0-...-673078a Latest Latest
Warning

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

Go to latest
Published: May 1, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package testhelpers contains routines to help test rulehunter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfigDirs

func BuildConfigDirs(e errorReporter, buildAllDirs bool) string

func CopyFile

func CopyFile(e errorReporter, srcFilename, dstDir string, args ...string)

func GetFilesInDir

func GetFilesInDir(t *testing.T, dir string) []string

func MustParse

func MustParse(layout, s string) time.Time

func MustWriteConfig

func MustWriteConfig(
	e errorReporter,
	baseDir string,
	maxNumRecords int64,
	args ...int,
)

func TempDir

func TempDir(e errorReporter) string

Types

type Entry

type Entry struct {
	Level Level
	Msg   string
}

func SortLogEntries

func SortLogEntries(entries []Entry) []Entry

type FileInfo

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

func NewFileInfo

func NewFileInfo(name string, modTime time.Time) FileInfo

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

func (FileInfo) Name

func (f FileInfo) Name() string

func (FileInfo) String

func (f FileInfo) String() string

type Level

type Level int
const (
	Info Level = iota
	Error
)

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) Error

func (l *Logger) Error(err error) error

func (*Logger) GetEntries

func (l *Logger) GetEntries(args ...bool) []Entry

GetEntries returns the entries from the log. If an argument is passed, it represents whether to make the errors unique.

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Run

func (l *Logger) Run(quit *quitter.Quitter)

func (*Logger) Running

func (l *Logger) Running() bool

Running returns whether Logger is running

func (*Logger) SetSvcLogger

func (l *Logger) SetSvcLogger(logger service.Logger)

Jump to

Keyboard shortcuts

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