Documentation
¶
Index ¶
- Constants
- Variables
- type Abstract
- type Call
- type Callable
- type Dep
- type File
- func (f *File) BuildDeps()
- func (f *File) EnumerateDecls()
- func (f *File) InjectDeps()
- func (f *File) LookupAbstract(name string) *Abstract
- func (f *File) LookupCallable(name string) *Callable
- func (f *File) LookupDepByScope(scope string) *Dep
- func (f *File) LookupName() string
- func (f *File) SearchCalls()
- func (f *File) SetupID()
- type Pkg
- type Project
- type ProjectMinify
- type Reference
- type SourceDir
- type SourceFile
- type SourceMap
Constants ¶
View Source
const ( CallTypeBuiltin = "builtin" CallTypeStd = "std" CallTypeInternal = "internal" CallTypeExternal = "external" CallTypePackage = "package" )
View Source
const LANG = "Golang"
View Source
const PARSER = "gopher"
View Source
const PARSER_TYPE = "Golang"
View Source
const PARSE_TYPE_MINIFY = "minify"
View Source
const PARSE_TYPE_NORMAL = "normal"
View Source
const VERSION = "v0.2.0-beta"
Variables ¶
View Source
var Builtins = map[string]byte{
"len": 0,
"append": 0,
"delete": 0,
"make": 0,
"string": 0,
"int": 0,
"uint": 0,
"uintptr": 0,
"int8": 0,
"uint8": 0,
"int16": 0,
"uint16": 0,
"int32": 0,
"uint32": 0,
"int64": 0,
"uint64": 0,
"float32": 0,
"float64": 0,
"new": 0,
"panic": 0,
"defer": 0,
"copy": 0,
"byte": 0,
"close": 0,
"rune": 0,
}
View Source
var Libs = map[string]byte{
"archive": 0,
"arena": 0,
"bufio": 0,
"builtin": 0,
"bytes": 0,
"cmd": 0,
"cmp": 0,
"compress": 0,
"container": 0,
"context": 0,
"crypto": 0,
"database": 0,
"database/sql": 0,
"debug": 0,
"embed": 0,
"encoding": 0,
"encoding/hex": 0,
"errors": 0,
"expvars": 0,
"flag": 0,
"fmt": 0,
"go": 0,
"hash": 0,
"html": 0,
"image": 0,
"index": 0,
"io": 0,
"log": 0,
"maps": 0,
"math": 0,
"mime": 0,
"net": 0,
"net/netip": 0,
"os": 0,
"path": 0,
"path/filepath": 0,
"plugin": 0,
"reflect": 0,
"regexp": 0,
"runtime": 0,
"slices": 0,
"sort": 0,
"strconv": 0,
"strings": 0,
"sync": 0,
"sync/atomic": 0,
"syscall": 0,
"testing": 0,
"text": 0,
"time": 0,
"unicode": 0,
"unsafe": 0,
"net/http": 0,
}
common std lib cd /usr/local/go/src/ && ls -d */ | cut -f1 -d'/'
Functions ¶
This section is empty.
Types ¶
type Abstract ¶
type Abstract struct {
ID string `json:"id"`
Pos string `json:"pos"`
Name string `json:"name"`
File string `json:"file"`
Pkg string `json:"pkg"`
Comment string `json:"comment"`
Fields []string `json:"fields"`
// contains filtered or unexported fields
}
func NewAbstract ¶
func (*Abstract) LookupName ¶
type Call ¶
type Call struct {
ID string `json:"id"`
Pos string `json:"pos"`
Caller string `json:"caller"`
Callee string `json:"callee"`
File string `json:"file"`
Typ string `json:"typ"`
Signature string `json:"signature"`
Dep string `json:"dep"`
// contains filtered or unexported fields
}
func (*Call) LookupName ¶
type Callable ¶
type Callable struct {
ID string `json:"id"`
Pos string `json:"pos"`
Name string `json:"name"`
Signature string `json:"signature"`
Abstract string `json:"abstract"`
File string `json:"file"`
Pkg string `json:"pkg"`
Comment string `json:"comment"`
Parameters []string `json:"parameters"`
Results []string `json:"results"`
Method bool `json:"method"`
Private bool `json:"private"`
// contains filtered or unexported fields
}
func (*Callable) LookupName ¶
func (*Callable) SetupMethod ¶
func (c *Callable) SetupMethod()
type Dep ¶
type File ¶
type File struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Pkg string `json:"pkg"`
Deps []string `json:"deps"`
Imports []string `json:"imports"`
// contains filtered or unexported fields
}
func NewSourceFile ¶
func (*File) EnumerateDecls ¶
func (f *File) EnumerateDecls()
func (*File) InjectDeps ¶
func (f *File) InjectDeps()
func (*File) LookupAbstract ¶
func (*File) LookupCallable ¶
func (*File) LookupDepByScope ¶
func (*File) LookupName ¶
func (*File) SearchCalls ¶
func (f *File) SearchCalls()
type Pkg ¶
type Pkg struct {
ID string `json:"id"`
Name string `json:"name"`
FullName string `json:"fullName"`
Path string `json:"path"`
Imports []string `json:"imports"`
// contains filtered or unexported fields
}
func NewSourcePkg ¶
func (*Pkg) InjectImports ¶
func (p *Pkg) InjectImports()
func (*Pkg) LookupAbstract ¶
func (*Pkg) LookupCallable ¶
func (*Pkg) LookupName ¶
type Project ¶
type Project struct {
Name string `json:"name"`
Lang string `json:"lang"`
Parser string `json:"parser"`
Timestamp string `json:"timestamp"`
Repository string `json:"repository"`
Typ string `json:"typ"`
Version string `json:"version"`
Pkgs []*Pkg `json:"pkgs"`
Files []*File `json:"files"`
Abstracts []*Abstract `json:"absts"`
Callables []*Callable `json:"fns"`
Calls []*Call `json:"calls"`
References []*Reference `json:"refs"`
Deps []*Dep `json:"deps"`
// contains filtered or unexported fields
}
func NewProject ¶
func (*Project) Initialize ¶
func (p *Project) Initialize()
scan the whole project to get the directories and files
type ProjectMinify ¶
type ProjectMinify struct {
Name string `json:"name"`
Lang string `json:"lang"`
Parser string `json:"parser"`
Timestamp string `json:"timestamp"`
Repository string `json:"repository"`
Version string `json:"version"`
Typ string `json:"typ"`
Abstracts uint64 `json:"absts"`
Callables uint64 `json:"fns"`
Calls uint64 `json:"calls"`
References uint64 `json:"refs"`
Deps uint64 `json:"deps"`
Pkgs []*Pkg `json:"pkgs"`
Files []*File `json:"files"`
}
type SourceFile ¶
type SourceFile struct {
Path string
Name string
Dir *SourceDir
AST *ast.File
GoSource bool
Test bool
Error string
}
func (*SourceFile) Parse2AST ¶
func (sf *SourceFile) Parse2AST(fset *token.FileSet)
type SourceMap ¶
type SourceMap struct {
// contains filtered or unexported fields
}
read-only source map of the project
func NewSourceMap ¶
func (*SourceMap) Files ¶
func (sm *SourceMap) Files() []*SourceFile
Source Files
¶
Click to show internal directories.
Click to hide internal directories.