writers

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsvWriter

type CsvWriter struct {
	FilePath string
	// contains filtered or unexported fields
}

CsvWriter writes CSV files

func NewCsvWriter

func NewCsvWriter(destination string) (*CsvWriter, error)

NewCsvWriter gets a new CsvWriter

func (*CsvWriter) AddCtrl added in v0.1.2

func (cw *CsvWriter) AddCtrl(*models.TestCtrl) error

func (*CsvWriter) Finish

func (cw *CsvWriter) Finish() error

func (*CsvWriter) Write

func (cw *CsvWriter) Write(result *models.Host) error

Write a CSV line

type DbWriter

type DbWriter struct {
	URI string
	// contains filtered or unexported fields
}

DbWriter is a Database writer

func NewDbWriter

func NewDbWriter(uri string, debug bool) (*DbWriter, error)

NewDbWriter initialises a database writer

func (*DbWriter) AddCtrl added in v0.1.2

func (dw *DbWriter) AddCtrl(ctrl *models.TestCtrl) error

func (*DbWriter) Finish

func (dw *DbWriter) Finish() error

func (*DbWriter) Write

func (dw *DbWriter) Write(host *models.Host) error

Write results to the database

type JsonWriter

type JsonWriter struct {
	FilePath string
}

JsonWriter is a JSON lines writer

func NewJsonWriter

func NewJsonWriter(destination string) (*JsonWriter, error)

NewJsonWriter return a new Json lines writer

func (*JsonWriter) AddCtrl added in v0.1.2

func (jw *JsonWriter) AddCtrl(*models.TestCtrl) error

func (*JsonWriter) Finish

func (jw *JsonWriter) Finish() error

func (*JsonWriter) Write

func (jw *JsonWriter) Write(result *models.Host) error

Write JSON lines to a file

type NoneWriter

type NoneWriter struct {
}

NoneWriter is a None writer

func NewNoneWriter

func NewNoneWriter() (*NoneWriter, error)

NewNoneWriter initialises a none writer

func (*NoneWriter) AddCtrl added in v0.1.2

func (s *NoneWriter) AddCtrl(*models.TestCtrl) error

func (*NoneWriter) Finish

func (s *NoneWriter) Finish() error

func (*NoneWriter) Write

func (s *NoneWriter) Write(result *models.Host) error

Write does nothing

type StdoutWriter

type StdoutWriter struct {
	WriteAll bool
}

StdoutWriter is a Stdout writer

func NewStdoutWriter

func NewStdoutWriter() (*StdoutWriter, error)

NewStdoutWriter initialises a stdout writer

func (*StdoutWriter) AddCtrl added in v0.1.2

func (s *StdoutWriter) AddCtrl(*models.TestCtrl) error

func (*StdoutWriter) Finish

func (s *StdoutWriter) Finish() error

func (*StdoutWriter) FormatCN added in v0.1.2

func (s *StdoutWriter) FormatCN(cn string) string

func (*StdoutWriter) Write

func (s *StdoutWriter) Write(host *models.Host) error

Write results to stdout

type TextWriter

type TextWriter struct {
	FilePath string
	// contains filtered or unexported fields
}

StdoutWriter is a Stdout writer

func NewTextWriter

func NewTextWriter(destination string) (*TextWriter, error)

NewStdoutWriter initialises a stdout writer

func (*TextWriter) AddCtrl added in v0.1.2

func (t *TextWriter) AddCtrl(*models.TestCtrl) error

func (*TextWriter) Finish

func (t *TextWriter) Finish() error

func (*TextWriter) Write

func (t *TextWriter) Write(result *models.Host) error

Write results to stdout

type Writer

type Writer interface {
	Write(*models.Host) error
	AddCtrl(*models.TestCtrl) error
	Finish() error
}

Writer is a results writer

Jump to

Keyboard shortcuts

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