Documentation ¶
Index ¶
Constants ¶
const TemplateSimple = `` /* 173-byte string literal not displayed */
TemplateSimple constant for simple html pongo2 template
Variables ¶
var LogLevelArray = []string{"Debug", "Info", "Warn", "Error", "Fatal"}
LogLevelArray string denoting levels of logs
var LogLevelMap = map[string]int{
"debug": 0,
"info": 1,
"warn": 2,
"error": 3,
"fatal": 4,
}
LogLevelMap a map that holds the integer for a log level
Functions ¶
This section is empty.
Types ¶
type DistributionFormat ¶
type DistributionFormat struct { Severity struct { Debug []string `yaml:"debug,omitempty"` Info []string `yaml:"info,omitempty"` Warn []string `yaml:"warn,omitempty"` Error []string `yaml:"error,omitempty"` Fatal []string `yaml:"fatal,omitempty"` } `yaml:"severity"` }
DistributionFormat is for unmarshiling a email distributionList file
func ReadDistributionFormatYAMLFromFile ¶
func ReadDistributionFormatYAMLFromFile(path string) (format DistributionFormat, err error)
ReadDistributionFormatYAMLFromFile loads DistributionFormat data from a YAML file
func (DistributionFormat) GetEmails ¶
func (df DistributionFormat) GetEmails(level string) []string
GetEmails returns list of emails based on log level
type EmailHandler ¶
type EmailHandler struct { SMTPHost string SMTPPort string SenderEmail string SenderName string Recipients []string Subject string HTML bool }
EmailHandler initilization should contain any variables used for report
func (EmailHandler) HandleReport ¶
func (eh EmailHandler) HandleReport(reader io.Reader) (err error)
HandleReport consumes ReportReader output, writes to file
type FileHandler ¶
type FileHandler struct {
Filename string
}
FileHandler initilization should contain any variables used for report
func (FileHandler) HandleReport ¶
func (fr FileHandler) HandleReport(reader io.Reader) (err error)
HandleReport consumes ReportReader output, writes to file
type JSONReportRunner ¶
type JSONReportRunner struct{}
JSONReportRunner initilization should contain any variables used for report
func (JSONReportRunner) ReportReader ¶
func (jrr JSONReportRunner) ReportReader(reportSet Set) (io.Reader, error)
ReportReader Implementation for JSONReportRunner
type Pongo2ReportRunner ¶
Pongo2ReportRunner initilization with template object
func NewPongo2ReportRunnerFromFile ¶
func NewPongo2ReportRunnerFromFile(TemplateFilePath string) *Pongo2ReportRunner
NewPongo2ReportRunnerFromFile constructor with template file
func NewPongo2ReportRunnerFromString ¶
func NewPongo2ReportRunnerFromString(TemplateString string, StyleCSS bool) *Pongo2ReportRunner
NewPongo2ReportRunnerFromString constructor with template string
func (Pongo2ReportRunner) ReportReader ¶
func (p2rr Pongo2ReportRunner) ReportReader(reportSet Set) (io.Reader, error)
ReportReader Implementation for Pongo2ReportRunner
type PrintHandler ¶
type PrintHandler struct{}
PrintHandler initilization should contain any variables used for report
func (PrintHandler) HandleReport ¶
func (pr PrintHandler) HandleReport(reader io.Reader) (err error)
HandleReport consumes ReportReader output, prints to stdout
type Set ¶
Set structure for containing elements and metadata for a report
func FilterReportSet ¶
FilterReportSet by the logLevel
func (*Set) GetElementArray ¶
GetElementArray getter for Elements
func (*Set) GetMetadata ¶
GetMetadata getter for Metadata
func (*Set) GetReportMap ¶
GetReportMap converts a ReportSet to generic go map