{"modulePath":"github.com/hsqbyte/protospec","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\n## Functions\n\n```go\nfunc Run(ctx *Context, cmd string, args []string) error\n```\nRun dispatches to the appropriate command handler.\n\n## Types\n\n```go\ntype AuditFinding struct {\n\tSeverity string `json:\"severity\"` // \"high\", \"medium\", \"low\", \"info\"\n\tField    string `json:\"field\"`\n\tRule     string `json:\"rule\"`\n\tMessage  string `json:\"message\"`\n}\n```\nAuditFinding represents a security finding.\n\n```go\ntype Context struct {\n\tLib        *protocol.Library\n\tInputFile  string\n\tOutputFile string\n\tLang       string\n\tRaw        bool\n}\n```\nContext holds shared state for all CLI commands.\n\n```go\ntype FieldDiff struct {\n\tType     string `json:\"type\"` // \"added\", \"removed\", \"changed\"\n\tField    string `json:\"field\"`\n\tOldValue string `json:\"old_value,omitempty\"`\n\tNewValue string `json:\"new_value,omitempty\"`\n\tDetail   string `json:\"detail,omitempty\"`\n}\n```\nFieldDiff describes a difference between two protocol versions.\n\n```go\ntype TestCase struct {\n\tName     string         `json:\"name\"`\n\tProtocol string         `json:\"protocol\"`\n\tInput    string         `json:\"input\"`  // hex-encoded bytes for decode test\n\tExpect   map[string]any `json:\"expect\"` // expected decoded fields\n\tEncode   map[string]any `json:\"encode\"` // fields to encode\n\tOutput   string         `json:\"output\"` // expected hex-encoded bytes for encode test\n}\n```\nTestCase defines a single protocol test case.\n\n```go\ntype TestResult struct {\n\tName    string `json:\"name\"`\n\tPassed  bool   `json:\"passed\"`\n\tError   string `json:\"error,omitempty\"`\n\tDetails string `json:\"details,omitempty\"`\n}\n```\nTestResult holds the result of a single test.\n\n```go\ntype TestSuite struct {\n\tProtocol string     `json:\"protocol\"`\n\tTests    []TestCase `json:\"tests\"`\n}\n```\nTestSuite is a collection of test cases.\n\n","path":"github.com/hsqbyte/protospec/src/cli","name":"cli","synopsis":"","isRedistributable":true}
