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: 0

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