{"modulePath":"github.com/hsqbyte/protospec","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package codegen\n\n## Types\n\n```go\ntype Generator struct {\n\t// contains filtered or unexported fields\n}\n```\nGenerator generates Go source code from a protocol schema.\n\n```go\nfunc NewGenerator(lib *protocol.Library) *Generator\n```\nNewGenerator creates a new code generator.\n\n```go\nfunc (g *Generator) GenerateC(name string) (string, error)\n```\nGenerateC generates C struct code for the given protocol.\n\n```go\nfunc (g *Generator) GenerateEmbeddedC(name string) (string, error)\n```\nGenerateEmbeddedC generates embedded-friendly C code (no malloc, fixed buffers).\n\n```go\nfunc (g *Generator) GenerateFromTemplate(name, templateFile string) (string, error)\n```\nGenerateFromTemplate generates code using a custom Go text/template file.\n\n```go\nfunc (g *Generator) GenerateGo(name, pkgName string) (string, error)\n```\nGenerateGo generates Go source code for the given protocol.\n\n```go\nfunc (g *Generator) GeneratePython(name string) (string, error)\n```\nGeneratePython generates Python dataclass code for the given protocol.\n\n```go\nfunc (g *Generator) GenerateRust(name string) (string, error)\n```\nGenerateRust generates Rust struct code for the given protocol.\n\n```go\nfunc (g *Generator) GenerateTypeScript(name string) (string, error)\n```\nGenerateTypeScript generates TypeScript type definitions for the given protocol.\n\n```go\nfunc (g *Generator) GenerateWireshark(name string) (string, error)\n```\nGenerateWireshark generates a Lua dissector script for Wireshark.\n\n```go\ntype TemplateData struct {\n\tName      string\n\tVersion   string\n\tByteOrder string\n\tFields    []TemplateField\n}\n```\nTemplateData holds the data passed to custom templates.\n\n```go\ntype TemplateField struct {\n\tName      string\n\tType      string\n\tBitWidth  int\n\tByteWidth int\n\tComment   string\n}\n```\nTemplateField holds field data for templates.\n\n","path":"github.com/hsqbyte/protospec/src/codegen","name":"codegen","synopsis":"","isRedistributable":true}
