compliance

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package compliance provides RFC compliance testing for protocols.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComplianceReport

type ComplianceReport struct {
	Protocol  string       `json:"protocol"`
	Timestamp time.Time    `json:"timestamp"`
	Results   []TestResult `json:"results"`
	Summary   Summary      `json:"summary"`
}

ComplianceReport holds the full compliance report.

func (*ComplianceReport) ToHTML

func (report *ComplianceReport) ToHTML() string

ToHTML generates an HTML compliance report.

func (*ComplianceReport) ToJSON

func (report *ComplianceReport) ToJSON() (string, error)

ToJSON generates a JSON compliance report.

type Runner

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

Runner executes compliance tests.

func NewRunner

func NewRunner(lib *protocol.Library) *Runner

NewRunner creates a new compliance test runner.

func (*Runner) RunCompliance

func (r *Runner) RunCompliance(protoName string, samples [][]byte) (*ComplianceReport, error)

RunCompliance runs compliance tests for a protocol against sample data.

type Summary

type Summary struct {
	Total  int `json:"total"`
	Passed int `json:"passed"`
	Warned int `json:"warned"`
	Failed int `json:"failed"`
}

Summary holds pass/warn/fail counts.

type TestCase

type TestCase struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Category    string `json:"category"` // "required_fields", "value_range", "state_machine"
	Protocol    string `json:"protocol"`
}

TestCase defines a single compliance test.

type TestLevel

type TestLevel string

TestLevel represents the compliance test result level.

const (
	Pass TestLevel = "PASS"
	Warn TestLevel = "WARN"
	Fail TestLevel = "FAIL"
)

type TestResult

type TestResult struct {
	TestCase TestCase  `json:"test_case"`
	Level    TestLevel `json:"level"`
	Message  string    `json:"message"`
	Duration float64   `json:"duration_ms"`
}

TestResult holds the result of a compliance test.

Jump to

Keyboard shortcuts

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