Documentation ¶
Index ¶
- Constants
- Variables
- func AssertIsDirectory(dirPath string) error
- func Generate(packagePath string)
- func GoType(value string) string
- func GoTypeUsage(value string) string
- func WriteTemplate(outfile *os.File, tmpl *template.Template, view interface{})
- type ApiType
- type ApiTypeBaseClassIndex
- type ByEnumName
- type ByMethodName
- type ByName
- type ByPropertyName
- type BySignalName
- type Constants
- type GDAPI
- type GDAPIDoc
- type GDAPIs
- type GDArgument
- type GDEnums
- type GDMethod
- type GDMethodDoc
- type GDProperty
- type GDSignal
- type Usage
Constants ¶
View Source
const ( CoreApiType = iota ToolsApiType )
Variables ¶
View Source
var CToGoValueTypeMap = map[string]string{
"bool": "bool",
"uint8_t": "uint8",
"uint32_t": "uint32",
"uint64_t": "uint64",
"int64_t": "int64",
"double": "float64",
"wchar_t": "int32",
"char": "C.char",
"int": "int32",
"size_t": "int64",
"void": "void",
"string": "string",
"float": "float32",
"godot_real": "float32",
"godot_bool": "bool",
"godot_int": "int32",
"godot_object": "GodotObject",
"godot_vector3_axis": "Vector3Axis",
"godot_variant_type": "VariantType",
"godot_error": "Error",
"godot_string": "String",
}
CToGoValueTypeMap proves a translation between C to Go
Functions ¶
func AssertIsDirectory ¶
func Generate ¶
func Generate(packagePath string)
Generate reads in Godot's api.json and generates codegen of all the classes
func GoTypeUsage ¶
GoTypeUsage converts types in the api.json into generated Go types.
Types ¶
type ApiTypeBaseClassIndex ¶
type ByEnumName ¶
type ByEnumName []GDEnums
ByEnumName is used for sorting GDAPI objects by name
func (ByEnumName) Len ¶
func (c ByEnumName) Len() int
func (ByEnumName) Less ¶
func (c ByEnumName) Less(i, j int) bool
func (ByEnumName) Swap ¶
func (c ByEnumName) Swap(i, j int)
type ByMethodName ¶
type ByMethodName []GDMethod
ByMethodName is used for sorting GDAPI objects by name
func (ByMethodName) Len ¶
func (c ByMethodName) Len() int
func (ByMethodName) Less ¶
func (c ByMethodName) Less(i, j int) bool
func (ByMethodName) Swap ¶
func (c ByMethodName) Swap(i, j int)
type ByPropertyName ¶
type ByPropertyName []GDProperty
ByPropertyName is used for sorting GDAPI objects by name
func (ByPropertyName) Len ¶
func (c ByPropertyName) Len() int
func (ByPropertyName) Less ¶
func (c ByPropertyName) Less(i, j int) bool
func (ByPropertyName) Swap ¶
func (c ByPropertyName) Swap(i, j int)
type BySignalName ¶
type BySignalName []GDSignal
BySignalName is used for sorting GDAPI objects by name
func (BySignalName) Len ¶
func (c BySignalName) Len() int
func (BySignalName) Less ¶
func (c BySignalName) Less(i, j int) bool
func (BySignalName) Swap ¶
func (c BySignalName) Swap(i, j int)
type GDAPI ¶
type GDAPI struct { APIType string `json:"api_type"` BaseClass string `json:"base_class"` Constants Constants `json:"constants"` Enums []GDEnums `json:"enums"` Methods []GDMethod `json:"methods"` Name string `json:"name"` Properties []GDProperty `json:"properties"` Signals []GDSignal `json:"signals"` Singleton bool `json:"singleton"` SingletonName string `json:"singleton_name"` Instanciable bool `json:"Instanciable"` IsReference bool `json:"is_reference"` }
GDAPI is a structure for parsed JSON from godot_api.json.
func (GDAPI) ConstantPrefixName ¶
func (GDAPI) HasEnumValue ¶
func (GDAPI) ParentInterface ¶
func (GDAPI) PrefixName ¶
func (GDAPI) PrivatePrefixName ¶
type GDAPIDoc ¶
type GDAPIDoc struct { Name string `xml:"name,attr"` Description string `xml:"description"` Methods []GDMethodDoc `xml:"methods>method"` }
GDAPIDoc is a structure for parsed documentation.
type GDAPIs ¶
type GDAPIs []GDAPI
func (GDAPIs) FilterForObject ¶
func (GDAPIs) PartitionByBaseApiTypeAndClass ¶
func (a GDAPIs) PartitionByBaseApiTypeAndClass() ApiTypeBaseClassIndex
type GDArgument ¶
type GDArgument struct { DefaultValue string `json:"default_value"` HasDefaultValue bool `json:"has_default_value"` Name string `json:"name"` Type string `json:"type"` }
func (GDArgument) GoName ¶
func (m GDArgument) GoName() string
type GDMethod ¶
type GDMethod struct { Arguments []GDArgument `json:"arguments"` HasVarargs bool `json:"has_varargs"` IsConst bool `json:"is_const"` IsEditor bool `json:"is_editor"` IsFromScript bool `json:"is_from_script"` IsNoscript bool `json:"is_noscript"` IsReverse bool `json:"is_reverse"` IsVirtual bool `json:"is_virtual"` Name string `json:"name"` ReturnType string `json:"return_type"` }
func (GDMethod) CReturnType ¶
func (GDMethod) IsBuiltinReturnType ¶
func (GDMethod) MethodBindName ¶
type GDMethodDoc ¶
type GDProperty ¶
type GDSignal ¶
type GDSignal struct { Arguments []GDArgument `json:"arguments"` Name string `json:"name"` }
type Usage ¶
type Usage int8
Usage is an enum type categorizing data types for parsing and generating NativeScript classes.
func GoTypeAndUsage ¶
Click to show internal directories.
Click to hide internal directories.