Documentation ¶
Index ¶
- Variables
- type CommentStruct
- type Function
- type GoSourceFileStruct
- func (gsfs *GoSourceFileStruct) AppendFile(filename string) (err error)
- func (gsfs *GoSourceFileStruct) AstToFileAndBBuff(saveToFilename ...string) (bytesBuf *bytes.Buffer, err error)
- func (gsfs *GoSourceFileStruct) GetBuildConstraints() (bDir []string)
- func (gsfs *GoSourceFileStruct) GetFuncByName(fName string, unExported ...bool) (funct *Function)
- func (gsfs *GoSourceFileStruct) GetGlobalComments() (cs []CommentStruct)
- func (gsfs *GoSourceFileStruct) GetImportsOnly(filename string) (err error)
- func (gsfs *GoSourceFileStruct) GetStructByName(sName string) (stru *Structure)
- func (gsfs *GoSourceFileStruct) GetVarByName(vName string) (vari *Variable)
- func (gsfs *GoSourceFileStruct) GoSourceFileStructureSetup(filename string, zero ...bool) (err error)
- type Structure
- type Variable
Constants ¶
This section is empty.
Variables ¶
View Source
var (
GetGoEnv = gltsgsge.GetGoEnv
)
View Source
var KeyWordsList = []string{
"break",
"default",
"func",
"select",
"case",
"defer",
"go",
"struct",
"else",
"goto",
"package",
"switch",
"const",
"fallthrough",
"if",
"range",
"type",
"continue",
"for",
"import",
"return",
"var",
"append",
"cap",
"close",
"copy",
"delete",
"imag",
"len",
"make",
"new",
"panic",
"recover",
}
View Source
var TypesList = []string{
"chan",
"map",
"interface",
"uint",
"int",
"uintptr",
"uint8",
"uint16",
"uint32",
"uint64",
"int8",
"int16",
"int32",
"int64",
"float32",
"float64",
"complex64",
"complex128",
"byte",
"rune",
"true",
"false",
"bool",
"error",
"string",
"iota",
"nil",
"real",
"complex",
}
Functions ¶
This section is empty.
Types ¶
type CommentStruct ¶
type GoSourceFileStruct ¶
type GoSourceFileStruct struct { Filename, Eol, Package, GoSourcePath string PackageLineIdx int Imports []imported Func []Function Struct []Structure Var []Variable // contains filtered or unexported fields }
GoSourceFileStruct: contain AST file information
func GoSourceFileStructNew ¶
func GoSourceFileStructNew() (gsfs *GoSourceFileStruct, err error)
func GoSourcePkgStructSetup ¶
func GoSourcePkgStructSetup(path string) (*GoSourceFileStruct, error)
GoSourcePkgStructSetup: Recover all data from package files.
func (*GoSourceFileStruct) AppendFile ¶
func (gsfs *GoSourceFileStruct) AppendFile(filename string) (err error)
AppendFile:
func (*GoSourceFileStruct) AstToFileAndBBuff ¶
func (gsfs *GoSourceFileStruct) AstToFileAndBBuff(saveToFilename ...string) (bytesBuf *bytes.Buffer, err error)
AstToFileAndByteBuf: to simply display ast content for an overview of declarations. DEBUG purpose ...
func (*GoSourceFileStruct) GetBuildConstraints ¶
func (gsfs *GoSourceFileStruct) GetBuildConstraints() (bDir []string)
func (*GoSourceFileStruct) GetFuncByName ¶
func (gsfs *GoSourceFileStruct) GetFuncByName(fName string, unExported ...bool) (funct *Function)
GetFuncByName: Optional "unExported": empty = both.
func (*GoSourceFileStruct) GetGlobalComments ¶
func (gsfs *GoSourceFileStruct) GetGlobalComments() (cs []CommentStruct)
func (*GoSourceFileStruct) GetImportsOnly ¶
func (gsfs *GoSourceFileStruct) GetImportsOnly(filename string) (err error)
GetImportsOnly: translation to the internal function, designed fo kick use.
func (*GoSourceFileStruct) GetStructByName ¶
func (gsfs *GoSourceFileStruct) GetStructByName(sName string) (stru *Structure)
GetStructByName:
func (*GoSourceFileStruct) GetVarByName ¶
func (gsfs *GoSourceFileStruct) GetVarByName(vName string) (vari *Variable)
GetVarByName: "Position" contain the position in "list" and "values" fields.
func (*GoSourceFileStruct) GoSourceFileStructureSetup ¶
func (gsfs *GoSourceFileStruct) GoSourceFileStructureSetup(filename string, zero ...bool) (err error)
GoSourceFileStructureSetup: setup and retieve information for designed file. Notice: the lines numbers and offsets start at 0. Set "zero" at false to start at 1.
Click to show internal directories.
Click to hide internal directories.