gotools/godoc/index.go

type comparer

type interfaceSlice

type RunList

func (h RunList) sort(less comparer) {}

func (p *interfaceSlice) Len() int           {}

func (p *interfaceSlice) Less(i, j int) bool {}

func (p *interfaceSlice) Swap(i, j int)      {}

// Compress entries which are the same according to a sort criteria
// (specified by less) into "runs".
func (h RunList) reduce(less comparer, newRun func(h RunList) interface{}

const removeDuplicates

type KindRun

// KindRuns are sorted by line number or index. Since the isIndex bit
// is always the same for all infos in one list we can compare lori's.
func (k KindRun) Len() int           {}

func (k KindRun) Less(i, j int) bool {}

func (k KindRun) Swap(i, j int)      {}

// FileRun contents are sorted by Kind for the reduction into KindRuns.
func lessKind(x, y interface{}

// newKindRun allocates a new KindRun from the SpotInfo run h.
func newKindRun(h RunList) interface{}

type Pak

// Paks are sorted by name (primary key) and by import path (secondary key).
func (p *Pak) less(q *Pak) bool {}

type File

// Path returns the file path of f.
func (f *File) Path() string {}

type Spot

type FileRun

// Spots are sorted by file path for the reduction into FileRuns.
func lessSpot(x, y interface{}

// newFileRun allocates a new FileRun from the Spot run h.
func newFileRun(h RunList) interface{}

type PakRun

// Sorting support for files within a PakRun.
func (p *PakRun) Len() int           {}

func (p *PakRun) Less(i, j int) bool {}

func (p *PakRun) Swap(i, j int)      {}

// FileRuns are sorted by package for the reduction into PakRuns.
func lessFileRun(x, y interface{}

// newPakRun allocates a new PakRun from the *FileRun run h.
func newPakRun(h RunList) interface{}

type HitList

// PakRuns are sorted by package.
func lessPakRun(x, y interface{}

func reduce(h0 RunList) HitList {}

// filter returns a new HitList created by filtering
// all PakRuns from h that have a matching pakname.
func (h HitList) filter(pakname string) HitList {}

type wordPair

type AltWords

// wordPairs are sorted by their canonical spelling.
func lessWordPair(x, y interface{}

// newAltWords allocates a new AltWords from the *wordPair run h.
func newAltWords(h RunList) interface{}

func (a *AltWords) filter(s string) *AltWords {}

type Ident

type byImportCount

func (ic byImportCount) Len() int {}

func (ic byImportCount) Less(i, j int) bool {}

func (ic byImportCount) Swap(i, j int) {}

func (ic byImportCount) String() string {}

// filter creates a new Ident list where the results match the given
// package name.
func (ic byImportCount) filter(pakname string) []Ident {}

// top returns the top n identifiers.
func (ic byImportCount) top(n int) []Ident {}

type IndexResult

type Statistics

type Indexer

func (x *Indexer) intern(s string) string {}

func (x *Indexer) lookupPackage(path, name string) *Pak {}

func (x *Indexer) addSnippet(s *Snippet) int {}

func (x *Indexer) visitIdent(kind SpotKind, id *ast.Ident) {}

func (x *Indexer) visitFieldList(kind SpotKind, flist *ast.FieldList) {}

func (x *Indexer) visitSpec(kind SpotKind, spec ast.Spec) {}

func (x *Indexer) visitGenDecl(decl *ast.GenDecl) {}

func (x *Indexer) Visit(node ast.Node) ast.Visitor {}

// addFile adds a file to the index if possible and returns the file set file
// and the file's AST if it was successfully parsed as a Go file. If addFile
// failed (that is, if the file was not added), it returns file == nil.
func (x *Indexer) addFile(f vfs.ReadSeekCloser, filename string, goFile bool) (file *token.File, ast *ast.File) {}

var whitelisted

// isWhitelisted returns true if a file is on the list
// of "permitted" files for indexing. The filename must
// be the directory-local name of the file.
func isWhitelisted(filename string) bool {}

func (x *Indexer) indexDocs(dirname string, filename string, astFile *ast.File) {}

func (x *Indexer) indexGoFile(dirname string, filename string, file *token.File, astFile *ast.File) {}

func (x *Indexer) visitFile(dirname string, fi os.FileInfo) {}

type indexOptions

type LookupResult

type Index

func canonical(w string) string {}

const maxOpenFiles

const maxOpenDirs

func (c *Corpus) throttle() float64 {}

// NewIndex creates a new index for the .go files provided by the corpus.
func (c *Corpus) NewIndex() *Index {}

var ErrFileIndexVersion

const fileIndexVersion

type fileIndex

func (x *fileIndex) Write(w io.Writer) error {}

func (x *fileIndex) Read(r io.Reader) error {}

// WriteTo writes the index x to w.
func (x *Index) WriteTo(w io.Writer) (n int64, err error) {}

// ReadFrom reads the index from r into x; x must not be nil.
// If r does not also implement io.ByteReader, it will be wrapped in a bufio.Reader.
// If the index is from an old version, the error is ErrFileIndexVersion.
func (x *Index) ReadFrom(r io.Reader) (n int64, err error) {}

// Stats returns index statistics.
func (x *Index) Stats() Statistics {}

// ImportCount returns a map from import paths to how many times they were seen.
func (x *Index) ImportCount() map[string]int {}

// PackagePath returns a map from short package name to a set
// of full package path names that use that short package name.
func (x *Index) PackagePath() map[string]map[string]bool {}

// Exports returns a map from full package path to exported
// symbol name to its type.
func (x *Index) Exports() map[string]map[string]SpotKind {}

// Idents returns a map from identifier type to exported
// symbol name to the list of identifiers matching that name.
func (x *Index) Idents() map[SpotKind]map[string][]Ident {}

func (x *Index) lookupWord(w string) (match *LookupResult, alt *AltWords) {}

// isIdentifier reports whether s is a Go identifier.
func isIdentifier(s string) bool {}

// For a given query, which is either a single identifier or a qualified
// identifier, Lookup returns a SearchResult containing packages, a LookupResult, a
// list of alternative spellings, and identifiers, if any. Any and all results
// may be nil.  If the query syntax is wrong, an error is reported.
func (x *Index) Lookup(query string) (*SearchResult, error) {}

func (x *Index) Snippet(i int) *Snippet {}

type positionList

func (list positionList) Len() int           {}

func (list positionList) Less(i, j int) bool {}

func (list positionList) Swap(i, j int)      {}

// unique returns the list sorted and with duplicate entries removed
func unique(list []int) []int {}

type FileLines

// LookupRegexp returns the number of matches and the matches where a regular
// expression r is found in the full text index. At most n matches are
// returned (thus found <= n).
func (x *Index) LookupRegexp(r *regexp.Regexp, n int) (found int, result []FileLines) {}

// invalidateIndex should be called whenever any of the file systems
// under godoc's observation change so that the indexer is kicked on.
func (c *Corpus) invalidateIndex() {}

// feedDirnames feeds the directory names of all directories
// under the file system given by root to channel c.
func (c *Corpus) feedDirnames(ch chan<- string) {}

// fsDirnames() returns a channel sending all directory names
// of all the file systems under godoc's observation.
func (c *Corpus) fsDirnames() <-chan string {}

// CompatibleWith reports whether the Index x is compatible with the corpus
// indexing options set in c.
func (x *Index) CompatibleWith(c *Corpus) bool {}

func (c *Corpus) readIndex(filenames string) error {}

// ReadIndexFrom sets the current index from the serialized version found in r.
func (c *Corpus) ReadIndexFrom(r io.Reader) error {}

func (c *Corpus) UpdateIndex() {}

// RunIndexer runs forever, indexing.
func (c *Corpus) RunIndexer() {}

type countingWriter

func (c countingWriter) Write(p []byte) (n int, err error) {}

type byteReader

type countingReader

func (c countingReader) Read(p []byte) (n int, err error) {}

func (c countingReader) ReadByte() (b byte, err error) {}