Documentation
¶
Index ¶
- Variables
- func CommentGroupToText(comments *ast.CommentGroup) []string
- func GenerateConstants(goData []byte) (string, error)
- func TrimSlice(comments []string) []string
- type BoundMethod
- type ConstDef
- type EnumDef
- type EnumValue
- type ExternalStruct
- type Field
- type ImportDef
- type Model
- type ModelDefinitions
- type Parameter
- type ParameterType
- type ParsedPackage
- type Project
- func (p *Project) GenerateBinding(thisStructName string, method *BoundMethod, useIDs bool) (string, []string, map[packagePath]map[string]*ExternalStruct)
- func (p *Project) GenerateBindingTypescript(thisStructName string, method *BoundMethod, useIDs bool) (string, []string, map[packagePath]map[string]*ExternalStruct)
- func (p *Project) GenerateBindings(bindings map[string]map[string][]*BoundMethod, useIDs bool, useTypescript bool) map[string]map[string]string
- func (p *Project) GenerateModel(wr io.Writer, def *ModelDefinitions, options *flags.GenerateBindingsOptions) error
- func (p *Project) GenerateModels(models map[packagePath]map[structName]*StructDef, ...) (map[packagePath]string, error)
- func (p *Project) RelativeBindingsDir(dir *ParsedPackage, dir2 *ParsedPackage) string
- func (p *Project) RelativePackageDir(path string) string
- type Stats
- type StructDef
- type TypeDef
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoBindingsFound = errors.New("no bound structs found")
ErrNoBindingsFound is returned when no bound structs are found
Functions ¶
func CommentGroupToText ¶
func CommentGroupToText(comments *ast.CommentGroup) []string
func GenerateConstants ¶
Types ¶
type BoundMethod ¶
type BoundMethod struct {
Package string
PackageDir string
Name string
DocComment string
Inputs []*Parameter
Outputs []*Parameter
ID uint32
Alias *uint32
}
func (BoundMethod) IDAsString ¶
func (m BoundMethod) IDAsString() string
type ExternalStruct ¶
type Field ¶
type Field struct {
Name string
Type *ParameterType
Project *Project
}
func (*Field) DefaultValue ¶
type ModelDefinitions ¶
type Parameter ¶
type Parameter struct {
Name string
Type *ParameterType
// contains filtered or unexported fields
}
func (*Parameter) NamespacedStructType ¶
func (*Parameter) NamespacedStructVariable ¶
type ParameterType ¶
type ParameterType struct {
Name string
IsStruct bool
IsSlice bool
IsPointer bool
IsEnum bool
MapKey *ParameterType
MapValue *ParameterType
Package string
}
type ParsedPackage ¶
type Project ¶
type Project struct {
Path string
BoundMethods map[packagePath]map[structName][]*BoundMethod
Models map[packagePath]map[structName]*StructDef
Types map[packagePath]map[structName]*TypeDef
Stats Stats
// contains filtered or unexported fields
}
func GenerateBindingsAndModels ¶
func GenerateBindingsAndModels(options *flags.GenerateBindingsOptions) (*Project, error)
func ParseProject ¶
func (*Project) GenerateBinding ¶
func (p *Project) GenerateBinding(thisStructName string, method *BoundMethod, useIDs bool) (string, []string, map[packagePath]map[string]*ExternalStruct)
func (*Project) GenerateBindingTypescript ¶
func (p *Project) GenerateBindingTypescript(thisStructName string, method *BoundMethod, useIDs bool) (string, []string, map[packagePath]map[string]*ExternalStruct)
func (*Project) GenerateBindings ¶
func (*Project) GenerateModel ¶
func (p *Project) GenerateModel(wr io.Writer, def *ModelDefinitions, options *flags.GenerateBindingsOptions) error
func (*Project) GenerateModels ¶
func (*Project) RelativeBindingsDir ¶
func (p *Project) RelativeBindingsDir(dir *ParsedPackage, dir2 *ParsedPackage) string
func (*Project) RelativePackageDir ¶
type StructDef ¶
func (*StructDef) DefaultValueList ¶
Click to show internal directories.
Click to hide internal directories.