reporting

package
v0.0.0-...-7cac148 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red = iota
	Green
	Yellow
	Grey
)
View Source
const (
	Failed = iota
	Success
	Warning
	SquareBracket
	Skipped
)

Variables

This section is empty.

Functions

func VerificationReports

func VerificationReports(reports []VerificationReport, reporting Reporting, nodeInfoMap map[string][]Info)

Types

type Info

type Info struct {
	Hostip        string         `json:"hostip,omitempty"`
	Parameter     string         `json:"parameter,omitempty"`
	Status        string         `json:"status,omitempty"`
	StatusMessage *StatusMessage `json:"statusMessage,omitempty"`
	SummaryInfo   *SummaryInfo   `json:"summaryInfo,omitempty"`
}

type Reporting

type Reporting interface {
	GetTable(key string) *Table
	SetTable(key string, table *Table)
	GetAllTableKeys() []string
	GetAllTables() map[string]*Table
	AppendSpecialCharater(symbol int, str string) string
	ChangeColour(fgColor int, msg string) string
	GenerateTableOutputAndPrint(table *Table)
}

func NewReportingModule

func NewReportingModule(wr *cli.Writer, tables map[string]*Table) Reporting

type ReportingModule

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

func (*ReportingModule) AppendSpecialCharater

func (r *ReportingModule) AppendSpecialCharater(symbol int, str string) string

AppendSpecialCharater returns a string. Function appends a special char at the start of the str provided in arguments and returns that string

func (*ReportingModule) ChangeColour

func (r *ReportingModule) ChangeColour(fgColor int, msg string) string

ChangeColour returns a string. Function changes the color of the msg provided in arguments to the color given

func (*ReportingModule) GenerateTableOutputAndPrint

func (r *ReportingModule) GenerateTableOutputAndPrint(tb *Table)

GenerateTableOutputAndPrint prints table provided as argument

func (*ReportingModule) GetAllTableKeys

func (r *ReportingModule) GetAllTableKeys() []string

GetAllTableKeys returns all keys present in tables map

func (*ReportingModule) GetAllTables

func (r *ReportingModule) GetAllTables() map[string]*Table

GetAllTables returns tables map

func (*ReportingModule) GetTable

func (r *ReportingModule) GetTable(key string) *Table

GetTable returns table present in tables map for given key.

func (*ReportingModule) SetTable

func (r *ReportingModule) SetTable(key string, table *Table)

SetTable sets the value of tables[key] in tables map to table provided in argument

type StatusMessage

type StatusMessage struct {
	MainMessage string   `json:"mainMessage,omitempty"`
	SubMessage  []string `json:"subMessage,omitempty"`
}

type SummaryInfo

type SummaryInfo struct {
	SuccessfulCount int      `json:"successfulCount,omitempty"`
	FailedCount     int      `json:"failedCount,omitempty"`
	ToResolve       []string `json:"toResolve,omitempty"`
}

type Table

type Table struct {
	Title     string
	Rows      []table.Row
	Header    table.Row
	Footer    table.Row
	ColConfig []table.ColumnConfig
}

type VerificationReport

type VerificationReport struct {
	TableKey string
	Report   Info
}

Jump to

Keyboard shortcuts

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