Documentation ¶
Index ¶
- func Declare(vars ...string) *declarationValues
- func Err() *identifierValue
- func FuncCall(name string) *qualNameFuncValue
- 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 Len(val Value) *goFuncValue
- func Nil() *identifierValue
- func QualFuncCall(alias, name string) *qualNameFuncValue
- func QualIdentifier(alias, name string) *identifierValue
- func QualThis(alias, typeName string) *thisValue
- func String(strValue string) *identifierValue
- func This(typeName string) *thisValue
- type Block
- type File
- func (f *File) CommentF(format string, args ...interface{}) *File
- func (f *File) Func(name string) *funcBlock
- func (f *File) GenerateGetter(this *thisValue, fieldName string, returnType *ReturnTypeDecl)
- func (f *File) GoString() string
- func (f *File) Imports(imports ...*importLine) *File
- func (f *File) Method(this *thisValue, name string) *methodBlock
- func (f *File) Save(filePath string) error
- type ParamValue
- type ReturnTypeDecl
- type Stmt
- type StructPropertyValue
- type Value
- type VarValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Declare ¶
func Declare(vars ...string) *declarationValues
Declare creates a new declaration statement without variable values (will not compile). In order to declare variables 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 Len ¶
func Len(val Value) *goFuncValue
Len creates a new function call of the Go build-in function `len()`
func QualFuncCall ¶
func QualFuncCall(alias, name string) *qualNameFuncValue
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 QualThis ¶
func QualThis(alias, typeName string) *thisValue
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) GenerateGetter ¶
func (f *File) GenerateGetter(this *thisValue, fieldName string, returnType *ReturnTypeDecl)
GenerateGetter creates a public getter method according to the field
type ParamValue ¶ added in v0.0.4
type ParamValue struct {
// contains filtered or unexported fields
}
func QualParam ¶
func QualParam(name, alias, typeName string) *ParamValue
QualParam creates a new function parameter with a package alias
func (*ParamValue) Pointer ¶ added in v0.0.4
func (p *ParamValue) Pointer() *ParamValue
Pointer turns the parameter into a pointer type
type ReturnTypeDecl ¶ added in v0.0.5
type ReturnTypeDecl struct {
// contains filtered or unexported fields
}
func QualReturnType ¶
func QualReturnType(alias, name string) *ReturnTypeDecl
QualReturnType creates a new return type with an alias of an imported package
func ReturnType ¶
func ReturnType(name string) *ReturnTypeDecl
ReturnType creates a new return type for a function
func ReturnTypeError ¶
func ReturnTypeError() *ReturnTypeDecl
ReturnTypeError create a new return type of type `error`
func (*ReturnTypeDecl) Pointer ¶ added in v0.0.5
func (r *ReturnTypeDecl) Pointer() *ReturnTypeDecl
Pointer turns the return type into a pointer value
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
Source Files ¶
- block_comment.go
- block_func.go
- block_funcReturnType.go
- block_import.go
- block_method.go
- block_package.go
- main_assign.go
- main_file.go
- main_interfaces.go
- stmt_declare.go
- stmt_declareVars.go
- stmt_if.go
- stmt_return.go
- stmt_utils.go
- util_getter.go
- util_sb.go
- value_call.go
- value_equals.go
- value_field.go
- value_funcCall.go
- value_funcParam.go
- value_goFunc.go
- value_identifier.go
- value_methodThis.go
- value_name.go
- value_struct.go
- value_utils.go