Documentation ¶
Index ¶
- Variables
- func NormalizeLang(lang string) string
- type CSharpGenerator
- type Class
- type Constructor
- type CppGenerator
- type ES6Generator
- type Field
- type Generator
- type GoGenerator
- type JavaGenerator
- type JsonGenerator
- type Language
- type Method
- type Package
- type Parameter
- type Parent
- type PythonGenerator
- type RubyGenerator
- type XmlGenerator
- type YamlGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ExamplePkg = Package{ Name: "main", UseSpaces: false, Classes: []Class{ { Name: "Fruit", }, { Name: "Apple", Parent: Parent{ Name: "Fruit", Access: "public", }, Fields: []Field{ { Access: "public", Type: "string", Name: "colour", Default: `"red"`, }, { Access: "public", Type: "string", Static: true, Name: "sort", Default: `"Golden"`, }, { Access: "private", Type: "int", Name: "size", Default: "1", }, }, Methods: []Method{ { Access: "private", Name: "print", Parameters: []Parameter{ { Pass: "&", Name: "colour", Type: "string", Const: true, }, }, }, { Access: "protected", Return: "int", Static: true, Name: "getSize", }, { Access: "public", Return: "string", Name: "getColor", Const: true, }, }, }, { Access: "private", Name: "Seed", Fields: []Field{ { Access: "public", Type: "int", Name: "size", }, }, Methods: []Method{ { Static: true, Access: "public", Return: "int", Name: "transform", Const: true, }, }, }, }, } Generators = map[string]Language{ "java": {&JavaGenerator{}, "java", "/* %s */"}, "go": {&GoGenerator{}, "go", "/* %s */"}, "ruby": {&RubyGenerator{}, "rb", "# %s\n"}, "cpp": {&CppGenerator{}, "h", "/* %s */"}, "python": {&PythonGenerator{}, "py", "# %s\n"}, "js_es6": {&ES6Generator{}, "js", "/* %s */"}, "csharp": {&CSharpGenerator{}, "cs", "/* %s */"}, "xml": {&XmlGenerator{}, "xml", "<!-- %s -->"}, "json": {&JsonGenerator{}, "json", ""}, "yaml": {&YamlGenerator{}, "yml", "# %s\n"}, } )
Functions ¶
func NormalizeLang ¶
Types ¶
type CSharpGenerator ¶
type CSharpGenerator struct{}
type Class ¶
type Class struct { Name string `xml:"name" json:"name" yml:"name"` Fields []Field `xml:"fields>field" json:"fields" yml:"fields"` Methods []Method `xml:"methods>method" json:"methods" yml:"methods"` Constructors []Constructor `xml:"constructors>constructor" json:"constructors" yml:"constructors"` Classes []Class `xml:"classes>class" json:"classes" yml:"classes"` Parent Parent `xml:"parent" json:"parent" yml:"parent"` Access string `xml:"access" json:"access" yml:"access"` }
type Constructor ¶
type CppGenerator ¶
type CppGenerator struct{}
type ES6Generator ¶
type ES6Generator struct{}
type Field ¶
type Field struct { Name string `xml:"name" json:"name" yml:"name"` Type string `xml:"type" json:"type" yml:"type"` Const bool `xml:"const" json:"const" yml:"const"` Pointer bool `xml:"pointer" json:"pointer" yml:"pointer"` Default string `xml:"default" json:"default" yml:"default"` Access string `xml:"access" json:"access" yml:"access"` Static bool `xml:"static" json:"static" yml:"static"` }
type Generator ¶
type Generator interface { Generate(class Package) map[string]string // contains filtered or unexported methods }
func GetGenerator ¶
type GoGenerator ¶
type GoGenerator struct{}
type JavaGenerator ¶
type JavaGenerator struct{}
type JsonGenerator ¶
type JsonGenerator struct{}
type Method ¶
type Method struct { Name string `xml:"name" json:"name" yml:"name"` Return string `xml:"return" json:"return" yml:"return"` Access string `xml:"access" json:"access" yml:"access"` Const bool `xml:"const" json:"const" yml:"const"` Static bool `xml:"static" json:"static" yml:"static"` Parameters []Parameter `xml:"parameters>parameter" json:"parameters" yml:"parameters"` }
type Package ¶
type Package struct { Name string `xml:"name" json:"name" yml:"name"` Classes []Class `xml:"classes>class" json:"classes" yml:"classes"` Functions []Method `xml:"functions>function" json:"functions" yml:"functions"` Variables []Field `xml:"variables>variable" json:"variables" yml:"variables"` UseSpaces bool `xml:"use_spaces" json:"use_spaces" yml:"use_spaces"` }
type PythonGenerator ¶
type PythonGenerator struct{}
type RubyGenerator ¶
type RubyGenerator struct{}
type XmlGenerator ¶
type XmlGenerator struct{}
type YamlGenerator ¶
type YamlGenerator struct{}
Click to show internal directories.
Click to hide internal directories.