outputs

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = make(map[string]func(cfg *config.Config, outCfg *config.Output) (Output, error))

Factories contains the list of all available outputs. The outputs can each then be created using the function saved in the map.

Functions

func GetFilenameFromPattern

func GetFilenameFromPattern(pattern string, role string, data Data, extra map[string]interface{}) (string, error)

GetFilenameFromPattern get filename from given pattern, data and extra data for templating.

Types

type Data

type Data struct {
	TestStartTime  time.Time
	TestTime       time.Time
	Tester         string
	ServerHost     string
	ClientHost     string
	AdditionalInfo string
	Data           DataFormat
}

Data structured parsed data

type DataFormat

type DataFormat interface {
	// Transform run transformations on the `Data`.
	Transform(ts []*config.Transformation) error
}

DataFormat DataFormat interface that must be implemented by data formats, e.g., Table.

type Output

type Output interface {
	// Do do output related work on the given Data
	Do(data Data) error
	// OutputFiles return a list of output files
	OutputFiles() []string
	// Close run "cleanup" / close tasks, e.g., close file handles and others
	Close() error
}

Output is the interface a output has to implement.

type Row

type Row struct {
	Value interface{}
}

Row Row of the Table data format

type Table

type Table struct {
	DataFormat
	Headers []*Row
	Rows    [][]*Row
}

Table Data format for data in Table form

func (*Table) CheckIfHeaderExists added in v0.2.5

func (d *Table) CheckIfHeaderExists(name interface{}) (int, bool)

CheckIfHeaderExists check if a header exists by name in the Table

func (*Table) GetHeaderIndexByName added in v0.2.5

func (d *Table) GetHeaderIndexByName(name string) (int, error)

GetHeaderIndexByName return the header index for a given key (name) string

func (*Table) Transform added in v0.2.5

func (d *Table) Transform(ts []*config.Transformation) error

Transform transformation of table data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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