Documentation ¶
Index ¶
- func Append(sliceValue Value, elementValues ...Value) *goFuncValue
- func Assign(vars ...string) *declarationValues
- func Declare(vars ...string) *declarationValues
- func Err() *identifierValue
- func For(decl *declarationStmt, check Value, postStatement Stmt) *forBlock
- func FuncCall(name string) *funcCallValue
- func Identifier(name string) *identifierValue
- func If(val Value) *ifStmt
- func IfDecl(declare *declarationStmt, val Value) *ifStmt
- func Import(path string) *importLine
- func ImportAlias(path, alias string) *importLine
- func InitStruct(structName string) *structValue
- func Int(intVal int) *identifierValue
- func Lambda() *lambdaValue
- func Len(val Value) *goFuncValue
- func MakeMap(mapType *MapTypeDecl) *goFuncValue
- func MakeMapWithCount(mapType *MapTypeDecl, count int) *goFuncValue
- func MakeSlice(sliceType *TypeDecl) *goFuncValue
- func MakeSliceWithCount(sliceType *TypeDecl, count int) *goFuncValue
- func New(identifier string) *newValue
- func Nil() *identifierValue
- func QualFuncCall(alias, name string) *funcCallValue
- func QualIdentifier(alias, name string) *identifierValue
- func QualNew(alias, identifier string) *newValue
- func QualThis(alias, typeName string) *thisDecl
- func String(strValue string) *identifierValue
- func This(typeName string) *thisDecl
- type Block
- type File
- func (f *File) AddImport(path string)
- func (f *File) AddImportAlias(path, alias string)
- func (f *File) CommentF(format string, args ...interface{}) *File
- func (f *File) DeclareVars(vars ...*VarValue) Block
- func (f *File) Func(name string) *funcBlock
- func (f *File) GenerateGetter(this *thisDecl, fieldName string, returnType *TypeDecl)
- func (f *File) GoString() string
- func (f *File) Imports(imports ...*importLine) *importsBlock
- func (f *File) Interface(interfaceName string) *interfaceBlock
- func (f *File) Method(this *thisDecl, name string) *methodBlock
- func (f *File) QualType(typeName, alias, baseType string) *typeBlock
- func (f *File) Save(filePath string) error
- func (f *File) Struct(structName string) *structBlock
- func (f *File) Type(typeName, baseType string) *typeBlock
- type FuncDeclaration
- type MapTypeDecl
- type ParamDecl
- func (p *ParamDecl) Array() *ParamDecl
- func (p *ParamDecl) GetFullType() string
- func (p *ParamDecl) GetIsArray() bool
- func (p *ParamDecl) GetIsPointer() bool
- func (p *ParamDecl) GetName() string
- func (p *ParamDecl) GetTypeAlias() string
- func (p *ParamDecl) GetTypeName() string
- func (p *ParamDecl) Pointer() *ParamDecl
- func (p *ParamDecl) SetIsArray(isArray bool) *ParamDecl
- func (p *ParamDecl) SetIsPointer(isPointer bool) *ParamDecl
- type PropertyDecl
- type Stmt
- type StructPropertyValue
- type TypeDecl
- func (t *TypeDecl) Array() *TypeDecl
- func (t *TypeDecl) GetIsPointer() bool
- func (t *TypeDecl) GetTypeAlias() string
- func (t *TypeDecl) GetTypeName() string
- func (t *TypeDecl) Pointer() *TypeDecl
- func (t *TypeDecl) SetIsArray(isArray bool) *TypeDecl
- func (t *TypeDecl) SetIsPointer(isPointer bool) *TypeDecl
- type Value
- type VarValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assign ¶ added in v0.0.7
func Assign(vars ...string) *declarationValues
Assign creates a new assignment statement without variable values (will not compile). In order to assign values call `Values()`
func Declare ¶
func Declare(vars ...string) *declarationValues
Declare creates a new declaration statement without variable values (will not compile). In order to assign values call `Values()`
func Identifier ¶
func Identifier(name string) *identifierValue
Identifier creates a new identifier (variable, value, etc.)
func IfDecl ¶ added in v0.0.5
func IfDecl(declare *declarationStmt, val Value) *ifStmt
Creates a new if statement with variable declaration
func Import ¶
func Import(path string) *importLine
Import creates a new import statemet without an alias
func ImportAlias ¶
func ImportAlias(path, alias string) *importLine
ImportAlias creates a new import statement with an alias
func InitStruct ¶ added in v0.0.6
func InitStruct(structName string) *structValue
InitStruct creates a new struct initialisation
func Lambda ¶ added in v0.0.10
func Lambda() *lambdaValue
Lambda creates a new lambda function value
func Len ¶
func Len(val Value) *goFuncValue
Len creates a new function call of the Go built-in function `len()`
func MakeMap ¶ added in v0.0.24
func MakeMap(mapType *MapTypeDecl) *goFuncValue
MakeMap creates a new function call of the Go built-in function `make()` for an empty map
func MakeMapWithCount ¶ added in v0.0.24
func MakeMapWithCount(mapType *MapTypeDecl, count int) *goFuncValue
MakeMapWithCount creates a new function call of the Go built-in function `make()` for a map with count
func MakeSlice ¶ added in v0.0.24
func MakeSlice(sliceType *TypeDecl) *goFuncValue
MakeSlice creates a new function call of the Go built-in function `make()` for an empty slice
func MakeSliceWithCount ¶ added in v0.0.24
MakeSliceWithCount creates a new function call of the Go built-in function `make()` for a slice with count
func New ¶ added in v0.0.14
func New(identifier string) *newValue
New creates a new pointer initialisation value
func QualFuncCall ¶
func QualFuncCall(alias, name string) *funcCallValue
QualFuncCall creates a new function call with a package alias
func QualIdentifier ¶
func QualIdentifier(alias, name string) *identifierValue
Identifier creates a new identifier with a package alias (variable, value, etc.)
func QualNew ¶ added in v0.0.14
func QualNew(alias, identifier string) *newValue
QualNew creates a new pointer initialisation value with an alias
func QualThis ¶
func QualThis(alias, typeName string) *thisDecl
QualThis creates a new this-parameter for a method with a package alias
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) AddImportAlias ¶ added in v0.0.13
AddImportAlias adds a new import statement with its package alias to the import block
func (*File) DeclareVars ¶ added in v0.0.9
DeclareVars creates a new variable declaration block
func (*File) GenerateGetter ¶
GenerateGetter creates a public getter method according to the field
func (*File) Imports ¶
func (f *File) Imports(imports ...*importLine) *importsBlock
Imports creates a new imports block
type FuncDeclaration ¶ added in v0.0.8
type FuncDeclaration struct {
// contains filtered or unexported fields
}
func FuncDecl ¶ added in v0.0.8
func FuncDecl(funcName string) *FuncDeclaration
FuncDecl creates a new function declaration
func (*FuncDeclaration) Params ¶ added in v0.0.8
func (f *FuncDeclaration) Params(params ...*ParamDecl) *FuncDeclaration
Params adds parameters to the function declaration
func (*FuncDeclaration) ReturnTypes ¶ added in v0.0.8
func (f *FuncDeclaration) ReturnTypes(returnTypes ...*TypeDecl) *FuncDeclaration
ReturnTypes adds return types to the function declaration
type MapTypeDecl ¶ added in v0.0.24
type MapTypeDecl struct {
// contains filtered or unexported fields
}
func MapType ¶ added in v0.0.24
func MapType(keyType *TypeDecl, valueType *TypeDecl) *MapTypeDecl
func (*MapTypeDecl) String ¶ added in v0.0.24
func (m *MapTypeDecl) String() string
type ParamDecl ¶ added in v0.0.7
type ParamDecl struct {
// contains filtered or unexported fields
}
func (*ParamDecl) GetFullType ¶ added in v0.0.16
GetFullType gets the full string representation of the type
func (*ParamDecl) GetIsArray ¶ added in v0.0.26
GetIsArray gets a flag whether or not the parameter is an array or not
func (*ParamDecl) GetIsPointer ¶ added in v0.0.17
GetIsPointer gets a flag whether or not the parameter type is a pointer
func (*ParamDecl) GetTypeAlias ¶ added in v0.0.16
GetTypeAlias return an alias of the type package (if any) from there the type is imported
func (*ParamDecl) GetTypeName ¶ added in v0.0.16
GetTypeName gets the type name of the parameter
func (*ParamDecl) SetIsArray ¶ added in v0.0.26
SetIsArray sets whether or not the parameter is an array
func (*ParamDecl) SetIsPointer ¶ added in v0.0.13
SetIsPointer sets whether or not the parameter is a pointer
type PropertyDecl ¶ added in v0.0.8
type PropertyDecl struct {
// contains filtered or unexported fields
}
func EmbeddedProperty ¶ added in v0.0.9
func EmbeddedProperty(typeName string) *PropertyDecl
EmbeddedProp crates a new embedded property
func Property ¶ added in v0.0.8
func Property(propertyName, typeName string) *PropertyDecl
Property creates a new property declaration
func QualEmbeddedProperty ¶ added in v0.0.9
func QualEmbeddedProperty(alias, typeName string) *PropertyDecl
QualEmbeddedProperty creates a new embedded property with a package alias
func QualProperty ¶ added in v0.0.8
func QualProperty(propertyName, alias, typeName string) *PropertyDecl
QualProperty creates a new property declaration with a package alias
func (*PropertyDecl) Pointer ¶ added in v0.0.8
func (p *PropertyDecl) Pointer() *PropertyDecl
Pointer turns the property into a pointer type
func (*PropertyDecl) SetIsPointer ¶ added in v0.0.13
func (p *PropertyDecl) SetIsPointer(isPointer bool) *PropertyDecl
SetIsPointer sets whether or not a property is a pointer
type Stmt ¶ added in v0.0.3
type Stmt interface {
// contains filtered or unexported methods
}
func DeclareVars ¶ added in v0.0.5
DeclareVars creates a new variable declaration statement
type StructPropertyValue ¶ added in v0.0.6
type StructPropertyValue struct {
// contains filtered or unexported fields
}
func PropValue ¶ added in v0.0.6
func PropValue(propertyName string, propertyValue Value) *StructPropertyValue
PropValue creates a new property with its value
type TypeDecl ¶ added in v0.0.19
type TypeDecl struct {
// contains filtered or unexported fields
}
func ReturnTypeError ¶
func ReturnTypeError() *TypeDecl
ReturnTypeError create a new type of type `error`
func (*TypeDecl) GetIsPointer ¶ added in v0.0.19
GetIsPointer gets a flag whether or not the type is a pointer
func (*TypeDecl) GetTypeAlias ¶ added in v0.0.19
GetTypeAlias gets a type alias (if any) of the return declaration
func (*TypeDecl) GetTypeName ¶ added in v0.0.19
GetTypeName gets a type name of the return declaration
func (*TypeDecl) SetIsArray ¶ added in v0.0.20
SetIsArray sets whether or not the type is an array
func (*TypeDecl) SetIsPointer ¶ added in v0.0.19
SetIsPointer sets whether or not the type is a pointer
type VarValue ¶ added in v0.0.5
type VarValue struct {
// contains filtered or unexported fields
}
func (*VarValue) SetIsPointer ¶ added in v0.0.13
SetIsPointer sets whether or not a variable is a pointer
Source Files ¶
- block_comment.go
- block_func.go
- block_funcParam.go
- block_import.go
- block_interface.go
- block_interfaceFunc.go
- block_method.go
- block_methodThis.go
- block_package.go
- block_struct.go
- block_structProp.go
- block_type.go
- help_name.go
- helper_call.go
- helper_mapType.go
- helper_type.go
- main_assign.go
- main_file.go
- main_interfaces.go
- stmt_declare.go
- stmt_declareVars.go
- stmt_defer.go
- stmt_for.go
- stmt_if.go
- stmt_increment.go
- stmt_return.go
- stmt_statements.go
- stmt_utils.go
- util_getter.go
- util_sb.go
- value_call.go
- value_cast.go
- value_comparison.go
- value_field.go
- value_funcCall.go
- value_goFunc.go
- value_identifier.go
- value_lambda.go
- value_new.go
- value_squireBrackets.go
- value_struct.go
- value_utils.go