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) 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 SourceDir
- type SourceFile
- type SourceMap
Constants ¶
View Source
const ( CallTypeBuiltin = "builtin" CallTypeStd = "std" CallTypeInternal = "internal" CallTypeExternal = "external" CallTypePackage = "package" )
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 ¶ added in v0.1.0
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 ¶ added in v0.1.0
type Callable ¶
type Callable struct { ID string `json:"id"` Pos string `json:"pos"` Name string `json:"name"` 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"` Orphan bool `json:"orphan"` // contains filtered or unexported fields }
func (*Callable) LookupName ¶ added in v0.1.0
type Dep ¶ added in v0.1.0
type File ¶
type File struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` Pkg string `json:"pkg"` // contains filtered or unexported fields }
func NewSourceFile ¶
func (*File) EnumerateDecls ¶
func (f *File) EnumerateDecls()
func (*File) LookupAbstract ¶ added in v0.1.0
func (*File) LookupCallable ¶ added in v0.1.0
func (*File) LookupDepByScope ¶ added in v0.1.0
func (*File) LookupName ¶ added in v0.1.0
func (*File) SearchCalls ¶
func (f *File) SearchCalls()
type Pkg ¶
type Pkg struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` // contains filtered or unexported fields }
func NewSourcePkg ¶
func (*Pkg) LookupAbstract ¶ added in v0.1.0
func (*Pkg) LookupCallable ¶ added in v0.1.0
func (*Pkg) LookupName ¶ added in v0.1.0
type Project ¶
type Project struct { Name string `json:"name"` Directory string `json:"directory"` Pkgs []*Pkg `json:"pkgs"` Files []*File `json:"files"` Abstracts []*Abstract `json:"abstracts"` Callables []*Callable `json:"callables"` Calls []*Call `json:"calls"` 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 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.