report

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator added in v0.3.0

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

Aggregator is a stateful object that aggregates validation and parser results for messages. It can be reset to clear its state and start fresh.

func NewAggregator added in v0.3.0

func NewAggregator(logger *zap.Logger) *Aggregator

func (*Aggregator) AddNonParsableMessage added in v0.3.0

func (a *Aggregator) AddNonParsableMessage(messageId string, parserResult parser.Result)

AddNonParsableMessage adds a message ID that could not be parsed, along with the parser result containing errors.

func (*Aggregator) AddParserResult added in v0.3.0

func (a *Aggregator) AddParserResult(messageId string, isRequest bool, parserResult parser.Result)

AddParserResult adds the parser result for a given message ID and request/response type.

func (*Aggregator) AddValidationResults added in v0.3.0

func (a *Aggregator) AddValidationResults(messageId string, isRequest bool, validationResult validator.ValidationResult)

AddValidationResults adds the validation results for a given message ID and request/response type.

func (*Aggregator) CreateReport added in v0.3.0

func (a *Aggregator) CreateReport() Report

CreateReport creates a report based on the collected results.

func (*Aggregator) GetStatistics added in v0.3.0

func (a *Aggregator) GetStatistics() Statistics

GetStatistics returns the request and response statistics.

func (*Aggregator) Reset added in v0.3.0

func (a *Aggregator) Reset()

Reset clears the aggregator's internal state

type Report

type Report struct {
	// InvalidMessages contains all the errors per message (request or response)
	InvalidMessages     map[string]map[string][]string `json:"invalid_messages"`
	NonParsableMessages map[string][]string            `json:"non_parsable_messages"`
	Statistics          Statistics                     `json:"statistics"`
}

type Results added in v0.3.0

type Results struct {
	validator.ValidationResult
	parser.Result
}

type Statistics added in v0.3.0

type Statistics struct {
	ValidRequests      int
	ValidResponses     int
	InvalidRequests    int
	InvalidResponses   int
	UnparsableMessages int
}

func (*Statistics) GetTotal added in v0.3.0

func (s *Statistics) GetTotal() int

func (*Statistics) GetTotalRequest added in v0.3.0

func (s *Statistics) GetTotalRequest() int

func (*Statistics) GetTotalResponses added in v0.3.0

func (s *Statistics) GetTotalResponses() int

func (*Statistics) InvalidRequestPercentage added in v0.3.0

func (s *Statistics) InvalidRequestPercentage() float64

func (*Statistics) InvalidResponsePercentage added in v0.3.0

func (s *Statistics) InvalidResponsePercentage() float64

func (*Statistics) TotalInvalidMessagesPercentage added in v0.3.0

func (s *Statistics) TotalInvalidMessagesPercentage() float64

func (*Statistics) TotalValidMessagesPercentage added in v0.3.0

func (s *Statistics) TotalValidMessagesPercentage() float64

func (*Statistics) ValidRequestPercentage added in v0.3.0

func (s *Statistics) ValidRequestPercentage() float64

func (*Statistics) ValidResponsePercentage added in v0.3.0

func (s *Statistics) ValidResponsePercentage() float64

Jump to

Keyboard shortcuts

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