Documentation
¶
Index ¶
- type Aggregator
- func (a *Aggregator) AddNonParsableMessage(messageId string, parserResult parser.Result)
- func (a *Aggregator) AddParserResult(messageId string, isRequest bool, parserResult parser.Result)
- func (a *Aggregator) AddValidationResults(messageId string, isRequest bool, validationResult validator.ValidationResult)
- func (a *Aggregator) CreateReport() Report
- func (a *Aggregator) GetStatistics() Statistics
- func (a *Aggregator) Reset()
- type Report
- type Results
- type Statistics
- func (s *Statistics) GetTotal() int
- func (s *Statistics) GetTotalRequest() int
- func (s *Statistics) GetTotalResponses() int
- func (s *Statistics) InvalidRequestPercentage() float64
- func (s *Statistics) InvalidResponsePercentage() float64
- func (s *Statistics) TotalInvalidMessagesPercentage() float64
- func (s *Statistics) TotalValidMessagesPercentage() float64
- func (s *Statistics) ValidRequestPercentage() float64
- func (s *Statistics) ValidResponsePercentage() float64
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 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
Click to show internal directories.
Click to hide internal directories.