index

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegexpPattern

func GetRegexpPattern(pat string, ignoreCase bool) string

Types

type ExcludedFile

type ExcludedFile struct {
	Filename string
	Reason   string
}

type FileMatch

type FileMatch struct {
	Filename string
	Matches  []*Match
}

type Index

type Index struct {
	// contains filtered or unexported fields
}

func Open

func Open(dir string) (*Index, error)

Open an existing snapshot

func (*Index) Destroy

func (n *Index) Destroy() error

func (*Index) GetDir

func (n *Index) GetDir() string

func (*Index) Search

func (n *Index) Search(pat string, opt *SearchOptions) (*SearchResponse, error)

type Match

type Match struct {
	Line       string
	LineNumber int
	Before     []string
	After      []string
}

type SearchOptions

type SearchOptions struct {
	IgnoreCase     bool
	LinesOfContext uint
	FileRegexp     string
	Offset         int
	Limit          int
}

type SearchResponse

type SearchResponse struct {
	Matches        []*FileMatch
	FilesWithMatch int
	FilesOpened    int           `json:"-"`
	Duration       time.Duration `json:"-"`
}

type Snapshot

type Snapshot string

func Build

func Build(dst, src string) (Snapshot, error)

func (Snapshot) Open

func (s Snapshot) Open() (*Index, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL