client

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRepos

func LoadRepos(repos map[string]*config.Repo, cfg *Config) error

Load the list of repositories from the API running on host.

func Search(r *Response, cfg *Config, pattern, repos, files string, context int, ignoreCase, stats bool) error

Executes a search on the API running on host.

Types

type Block

type Block struct {
	Lines   []string
	Matches []bool
	Start   int
}

type Config

type Config struct {
	HttpHeaders map[string]string `json:"http-headers"`
	Host        string            `json:"host"`
}

type Presenter

type Presenter interface {
	Present(
		re *regexp.Regexp,
		ctx int,
		repos map[string]*config.Repo,
		res *Response) error
}

func NewAckPresenter

func NewAckPresenter(w *os.File) Presenter

func NewGrepPresenter

func NewGrepPresenter(w *os.File) Presenter

type Response

type Response struct {
	Results map[string]*index.SearchResponse
	Stats   *struct {
		FilesOpened int
		Duration    int
	} `json:",omitempty"`
}

func SearchAndLoadRepos

func SearchAndLoadRepos(cfg *Config, pattern, repos, files string, context int, ignoreCase, stats bool) (*Response, map[string]*config.Repo, error)

Execute a search and load the list of repositories in parallel on the host.

Jump to

Keyboard shortcuts

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