Documentation ¶
Index ¶
- Variables
- func DiscoverList(list []*ast.Field) []*ast.Field
- func DiscoverNode(node ast.Node) ast.Node
- func DiscoverType(express ast.Expr) ast.Expr
- func Ident(names ...string) []ast.Expr
- func Output(code string)
- func Output2(code string)
- type FuncDecl
- func (f *FuncDecl) AddAssignStmt(varName []ast.Expr, varToken token.Token, varValue interface{}) *FuncDecl
- func (f *FuncDecl) AddCallExpr(funcName string, funcArg ...interface{}) *FuncDecl
- func (f *FuncDecl) AddComment(comment string) *FuncDecl
- func (f *FuncDecl) AddDeclStmt(varName, varType string) *FuncDecl
- func (f *FuncDecl) AddParam(varName, varType string) *FuncDecl
- func (f *FuncDecl) AddRecv(varName, varType string) *FuncDecl
- func (f *FuncDecl) AddResult(varName, varType string) *FuncDecl
- func (f *FuncDecl) AddReturnStmt(funcArg ...interface{}) *FuncDecl
- type GenDecl
- type StructChanger
- type StructCopier
- type Tree
- func (gt *Tree) AddFunc(fd *FuncDecl)
- func (gt *Tree) AddImport(gd *GenDecl)
- func (gt *Tree) AddImportSection(imports []string)
- func (gt *Tree) AddMainFunc()
- func (gt *Tree) AddNewAssignStmt(funcName string, varName []ast.Expr, varToken token.Token, ...) *Tree
- func (gt *Tree) AddNewImport(imp string) *Tree
- func (gt *Tree) AddNewVar(varName, varType, varComment string) *Tree
- func (gt *Tree) AddVar(gd *GenDecl)
- func (gt *Tree) Bytes(doFormat bool) ([]byte, error)
- func (gt *Tree) ChangeStruct(varName string, varValue []*ast.Field, varComments *ast.CommentGroup) error
- func (gt *Tree) FuncDecl(name string) *FuncDecl
- func (gt *Tree) Import() *GenDecl
- func (gt *Tree) ReadVar() (VarRead, error)
- func (gt *Tree) StructFields(varName string) ([]*ast.Field, *ast.CommentGroup, error)
- func (gt *Tree) Var() *GenDecl
- func (gt *Tree) WriteFile(filepath string, doFormat bool, dirPerm os.FileMode, filePerm os.FileMode) error
- func (gt *Tree) WriteVar(sc VarRead) error
- type Var
- type VarRead
- type VarWrite
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrVarMustString = errors.New("variable type must be a string") ErrVarNotFound = errors.New("variable not found") )
Functions ¶
func DiscoverList ¶
DiscoverList builds clean lists for ast
func DiscoverNode ¶
DiscoverType builds clean fields for ast
func DiscoverType ¶
DiscoverType builds clean fields for ast
Types ¶
type FuncDecl ¶
func (*FuncDecl) AddAssignStmt ¶
func (*FuncDecl) AddCallExpr ¶
func (*FuncDecl) AddComment ¶
func (*FuncDecl) AddDeclStmt ¶
func (*FuncDecl) AddReturnStmt ¶
type StructChanger ¶
type StructCopier ¶
type Tree ¶
Tree represents a fileset of code
func (*Tree) AddImportSection ¶
AddImport adds an import section with import paths
func (*Tree) AddMainFunc ¶
func (gt *Tree) AddMainFunc()
AddHelloMainFunc adds a main func the outputs: hello world
func (*Tree) AddNewAssignStmt ¶
func (gt *Tree) AddNewAssignStmt(funcName string, varName []ast.Expr, varToken token.Token, varValue interface{}) *Tree
AddNewImport adds an import
func (*Tree) AddNewImport ¶
AddNewImport adds an import
func (*Tree) ChangeStruct ¶
func (gt *Tree) ChangeStruct(varName string, varValue []*ast.Field, varComments *ast.CommentGroup) error
ChangeStruct changes the struct field list
func (*Tree) StructFields ¶
StructFields returns the struct fields
type Var ¶
type Var struct {
Name string
}
Var represents a variable so it's not confused with a string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.