Documentation
¶
Index ¶
- type Generator
- func (g *Generator) GenerateC(name string) (string, error)
- func (g *Generator) GenerateEmbeddedC(name string) (string, error)
- func (g *Generator) GenerateFromTemplate(name, templateFile string) (string, error)
- func (g *Generator) GenerateGo(name, pkgName string) (string, error)
- func (g *Generator) GeneratePython(name string) (string, error)
- func (g *Generator) GenerateRust(name string) (string, error)
- func (g *Generator) GenerateTypeScript(name string) (string, error)
- func (g *Generator) GenerateWireshark(name string) (string, error)
- type TemplateData
- type TemplateField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates Go source code from a protocol schema.
func NewGenerator ¶
NewGenerator creates a new code generator.
func (*Generator) GenerateEmbeddedC ¶
GenerateEmbeddedC generates embedded-friendly C code (no malloc, fixed buffers).
func (*Generator) GenerateFromTemplate ¶
GenerateFromTemplate generates code using a custom Go text/template file.
func (*Generator) GenerateGo ¶
GenerateGo generates Go source code for the given protocol.
func (*Generator) GeneratePython ¶
GeneratePython generates Python dataclass code for the given protocol.
func (*Generator) GenerateRust ¶
GenerateRust generates Rust struct code for the given protocol.
func (*Generator) GenerateTypeScript ¶
GenerateTypeScript generates TypeScript type definitions for the given protocol.
type TemplateData ¶
type TemplateData struct {
Name string
Version string
ByteOrder string
Fields []TemplateField
}
TemplateData holds the data passed to custom templates.
Click to show internal directories.
Click to hide internal directories.