reportmanager

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers struct {
	Key   string `json:"key" toml:"key"`
	Value string `json:"value" toml:"value"`
}

type Report

type Report struct {
	Score   Score       `json:"score"`
	Reports []ReportDef `json:"reports,omitempty"`
}

type ReportDef

type ReportDef struct {
	// whether its a warning or error
	Method   string         `json:"method,omitempty" toml:"method,omitempty"`
	Path     string         `json:"path,omitempty" toml:"path,omitempty"`
	Message  string         `json:"message" toml:"message"`
	Headers  []Headers      `json:"headers,omitempty" toml:"headers,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty" toml:"metadata,omitempty"`
}

type ReportManager

type ReportManager map[string]Report

func New

func New() ReportManager

func (ReportManager) GetTotalScore

func (r ReportManager) GetTotalScore() []Score

func (ReportManager) PushReport

func (r ReportManager) PushReport(ruleName string, data ReportDef)

func (ReportManager) SetScore

func (r ReportManager) SetScore(ruleName string, score Score)

type Score

type Score struct {
	Category string  `json:"category" toml:"category"`
	Value    float32 `json:"value" toml:"value"`
}

Jump to

Keyboard shortcuts

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