cli

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: 80 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx *Context, cmd string, args []string) error

Run dispatches to the appropriate command handler.

Types

type AuditFinding

type AuditFinding struct {
	Severity string `json:"severity"` // "high", "medium", "low", "info"
	Field    string `json:"field"`
	Rule     string `json:"rule"`
	Message  string `json:"message"`
}

AuditFinding represents a security finding.

type Context

type Context struct {
	Lib        *protocol.Library
	InputFile  string
	OutputFile string
	Lang       string
	Raw        bool
}

Context holds shared state for all CLI commands.

type FieldDiff

type FieldDiff struct {
	Type     string `json:"type"` // "added", "removed", "changed"
	Field    string `json:"field"`
	OldValue string `json:"old_value,omitempty"`
	NewValue string `json:"new_value,omitempty"`
	Detail   string `json:"detail,omitempty"`
}

FieldDiff describes a difference between two protocol versions.

type TestCase

type TestCase struct {
	Name     string         `json:"name"`
	Protocol string         `json:"protocol"`
	Input    string         `json:"input"`  // hex-encoded bytes for decode test
	Expect   map[string]any `json:"expect"` // expected decoded fields
	Encode   map[string]any `json:"encode"` // fields to encode
	Output   string         `json:"output"` // expected hex-encoded bytes for encode test
}

TestCase defines a single protocol test case.

type TestResult

type TestResult struct {
	Name    string `json:"name"`
	Passed  bool   `json:"passed"`
	Error   string `json:"error,omitempty"`
	Details string `json:"details,omitempty"`
}

TestResult holds the result of a single test.

type TestSuite

type TestSuite struct {
	Protocol string     `json:"protocol"`
	Tests    []TestCase `json:"tests"`
}

TestSuite is a collection of test cases.

Jump to

Keyboard shortcuts

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