generator

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFunctions = template.FuncMap{
	"lower": strings.ToLower,
}

Functions

func ExecuteTemplate

func ExecuteTemplate(tmpl *template.Template, name string, path string, data TemplateData) error

func Generate

func Generate(dir string, fileName string, wasm []byte, initFunction string) error

Types

type TemplateClass

type TemplateClass struct {
	Name             string
	GoName           string
	Constructors     []TemplateClassConstructor
	Properties       []TemplateClassProperty
	StaticProperties []TemplateClassProperty
	Methods          []TemplateClassMethod
	StaticMethods    []TemplateClassMethod
}

type TemplateClassConstructor

type TemplateClassConstructor struct {
	Name          string
	ArgumentTypes []string
}

type TemplateClassMethod

type TemplateClassMethod struct {
	GoName        string
	Name          string
	ArgumentTypes []string
	ReturnType    string
	ErrorValue    string
}

type TemplateClassProperty

type TemplateClassProperty struct {
	GoName     string
	Name       string
	SetterType string
	GetterType string
	ReadOnly   bool
	ErrorValue string
}

type TemplateConstant

type TemplateConstant struct {
	Name          string
	GoName        string
	Value         string
	GoType        string
	ValuePrefix   string
	ValueSuffix   string
	CanBeConstant bool
}

type TemplateData

type TemplateData struct {
	Pkg       string
	PkgPath   string
	Enums     []TemplateEnum
	Symbols   []TemplateSymbol
	Constants []TemplateConstant
	Classes   []TemplateClass
}

type TemplateEnum

type TemplateEnum struct {
	Name   string
	GoName string
	GoType string
	Values []TemplateEnumValue
}

type TemplateEnumValue

type TemplateEnumValue struct {
	Name   string
	GoName string
	Value  string
}

type TemplateSymbol

type TemplateSymbol struct {
	Symbol        string
	GoName        string
	ArgumentTypes []string
	ReturnType    string
	ErrorValue    string
}

Jump to

Keyboard shortcuts

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