Documentation
¶
Index ¶
- Variables
- func ToGoTypeName(value string) (string, classes.Usage)
- func ToPascalCase(value string) string
- type APIJson
- type APIVersion
- type ApiFunction
- type ApiFunctionName
- type ApiFunctions
- type ApiMetadata
- type Argument
- type Arguments
- type GoArgument
- type GoMethod
- type GoMethodType
- type GoProperty
- type GoType
- func (t GoType) IsCharPointer() bool
- func (t GoType) IsGoPrimative() bool
- func (t GoType) IsGodotObjectPointer() bool
- func (t GoType) IsGodotVariantPointerArray() bool
- func (t GoType) IsMethodBindPointer() bool
- func (t GoType) IsPointer() bool
- func (t GoType) IsPointerArray() bool
- func (t GoType) IsString() bool
- func (t GoType) IsStringName() bool
- func (t GoType) IsVoidPointer() bool
- func (t GoType) IsVoidPointerArray() bool
- func (t GoType) NoReturnValue() bool
- type GoTypeDef
- type ReferenceType
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiNameMap = map[string]ApiMetadata{
"CORE:1.0": {"CoreApi", "godot_gdnative_core_api_struct"},
"CORE:1.1": {"Core11Api", "godot_gdnative_core_1_1_api_struct"},
"CORE:1.2": {"Core12Api", "godot_gdnative_core_1_2_api_struct"},
"NATIVESCRIPT:1.0": {"NativescriptApi", "godot_gdnative_ext_nativescript_api_struct"},
"NATIVESCRIPT:1.1": {"Nativescript11Api", "godot_gdnative_ext_nativescript_1_1_api_struct"},
}
Functions ¶
func ToGoTypeName ¶
ToGoTypeName convert the C type into the expected Go type
func ToPascalCase ¶
Types ¶
type APIJson ¶
type APIJson struct { Core APIVersion `json:"core"` Extensions []APIVersion `json:"extensions"` }
ApiVersions is a structure based on `gdnative_api.json` in `godot_headers`.
func ParseGdnativeApiJson ¶
ParseGdnativeApiJson parses gdnative_api.json into a APIJson struct.
type APIVersion ¶
type APIVersion struct { Name *string `json:"name"` Type string `json:"type"` Version struct { Major int `json:"major"` Minor int `json:"minor"` } `json:"version"` Next *APIVersion `json:"next"` API ApiFunctions `json:"api"` // contains filtered or unexported fields }
APIVersion is a single APIVersion definition in `gdnative_api.json`
func (*APIVersion) AllVersions ¶
func (a *APIVersion) AllVersions() []APIVersion
func (*APIVersion) StructTypeAndVersion ¶
func (a *APIVersion) StructTypeAndVersion(structType string) string
type ApiFunction ¶
type ApiFunction struct { Name ApiFunctionName `json:"name"` ReturnType string `json:"return_type"` Arguments Arguments `json:"arguments"` }
func (ApiFunction) IsConstructor ¶
func (f ApiFunction) IsConstructor() bool
func (ApiFunction) ToGoMethod ¶
func (f ApiFunction) ToGoMethod(apiMetadata ApiMetadata) GoMethod
type ApiFunctionName ¶
type ApiFunctionName string
type ApiFunctions ¶
type ApiFunctions []ApiFunction
type ApiMetadata ¶
ApiMetadata represents the Go GDNative API struct
type Arguments ¶
type Arguments []Argument
func (*Arguments) DataTypeRegexMatch ¶
func (Arguments) ToDestAndArguments ¶
func (as Arguments) ToDestAndArguments() (*GoArgument, []GoArgument)
type GoArgument ¶
type GoMethod ¶
type GoMethod struct { Name string GoMethodType GoMethodType ReturnType GoType Receiver *GoArgument Arguments []GoArgument CName string ApiMetadata ApiMetadata }
func (*GoMethod) IsStringNameReceiver ¶
func (*GoMethod) IsStringNameReturnType ¶
func (*GoMethod) IsStringReceiver ¶
func (*GoMethod) IsStringReturnType ¶
type GoMethodType ¶
type GoMethodType int8
GoMethodType represents categories for each gdnative function exposed.
const ( // UnknownGoMethodType represents an unexpected parsing error. UnknownGoMethodType GoMethodType = iota // ConstructorGoMethodType is the constructor type. ConstructorGoMethodType // GlobalGoMethodType is a global function type. GlobalGoMethodType // ReceiverGoMethodType is a receiver method type. ReceiverGoMethodType )
type GoProperty ¶
type GoProperty struct { Base string // Base will let us know if this is a struct, int, etc. Name string // The Go type name in camelCase CName string // The C type name in snake_case Comment string // Contains the comment on the line of the struct IsPointer bool // Usually for properties; defines if it is a pointer type }
type GoType ¶
type GoType struct { HasConst bool ReferenceType ReferenceType CName string GoName string }
func (GoType) IsCharPointer ¶
func (GoType) IsGoPrimative ¶
func (GoType) IsGodotObjectPointer ¶
func (GoType) IsGodotVariantPointerArray ¶
func (GoType) IsMethodBindPointer ¶
func (GoType) IsPointerArray ¶
func (GoType) IsStringName ¶
func (GoType) IsVoidPointer ¶
func (GoType) IsVoidPointerArray ¶
func (GoType) NoReturnValue ¶
type GoTypeDef ¶
type GoTypeDef struct { Base string // C Typedef tag Comment string // Contains the comment on the line of the struct Name string // The Go type name in camelCase CHeaderFilename string // The header filename this type shows up in IsPointer bool // Usually for properties; defines if it is a pointer type CName string // The C type name in snake_case Properties []GoProperty // Optional C struct fields Usage classes.Usage // Usage of the type Constructors []GoMethod Methods []GoMethod }
GoTypeDef represents the C Typedef in the godot_headers
func (GoTypeDef) HasDestroyMethod ¶
type ReferenceType ¶
type ReferenceType int8
const ( NoneReferenceType ReferenceType = iota PointerReferenceType PointerArrayReferenceType )
Click to show internal directories.
Click to hide internal directories.