Documentation ¶
Index ¶
- Constants
- func LowerRegexp(r *syntax.Regexp) *syntax.Regexp
- func VisitAtoms(q Q, v func(q Q))
- type And
- type Branch
- type BranchRepos
- type BranchesRepos
- type Const
- type GobCache
- type Language
- type Not
- type Or
- type Q
- type RawConfig
- type Regexp
- type Repo
- type RepoRegexp
- type RepoSet
- type Substring
- type Symbol
- type Type
Constants ¶
const ( TypeFileMatch uint8 = iota TypeFileName TypeRepo )
Variables ¶
This section is empty.
Functions ¶
func VisitAtoms ¶
VisitAtoms runs `v` on all atom queries within `q`.
Types ¶
type Branch ¶
type Branch struct { Pattern string // exact is true if we want to Pattern to equal branch. Exact bool }
Branch limits search to a specific branch.
type BranchRepos ¶
BranchRepos is a (branch, sourcegraph repo ids bitmap) tuple. It is a Sourcegraph addition.
type BranchesRepos ¶
type BranchesRepos struct {
List []BranchRepos
}
BranchesRepos is a slice of BranchRepos to match. It is a Sourcegraph addition and only used in the RPC interface for efficient checking of large repo lists.
func NewSingleBranchesRepos ¶
func NewSingleBranchesRepos(branch string, ids ...uint32) *BranchesRepos
NewSingleBranchesRepos is a helper for creating a BranchesRepos which searches a single branch.
func (BranchesRepos) MarshalBinary ¶
func (q BranchesRepos) MarshalBinary() ([]byte, error)
MarshalBinary implements a specialized encoder for BranchesRepos.
func (*BranchesRepos) String ¶
func (q *BranchesRepos) String() string
func (*BranchesRepos) UnmarshalBinary ¶
func (q *BranchesRepos) UnmarshalBinary(b []byte) (err error)
UnmarshalBinary implements a specialized decoder for BranchesRepos.
type GobCache ¶
type GobCache struct { Q // contains filtered or unexported fields }
GobCache exists so we only pay the cost of marshalling a query once when we aggregate it out over all the replicas.
Our query and eval layer do not support GobCache. Instead, at the gob boundaries (RPC and Streaming) we check if the Q is a GobCache and unwrap it.
"I wish we could get rid of this code soon enough" - tomas
type Q ¶
type Q interface {
String() string
}
Q is a representation for a possibly hierarchical search query.
func ExpandFileContent ¶
Expand expands Substr queries into (OR file_substr content_substr) queries, and the same for Regexp queries..
type RawConfig ¶
type RawConfig uint64
RawConfig filters repositories based on their encoded RawConfig map.
type Regexp ¶
RegexpQuery is a query looking for regular expressions matches.
type RepoRegexp ¶
RepoRegexp is a Sourcegraph addition which searches documents where the repository name matches Regexp.
func (*RepoRegexp) GobDecode ¶
func (q *RepoRegexp) GobDecode(data []byte) error
GobDecode implements gob.Decoder.
func (*RepoRegexp) GobEncode ¶
func (q *RepoRegexp) GobEncode() ([]byte, error)
GobEncode implements gob.Encoder.
func (*RepoRegexp) String ¶
func (q *RepoRegexp) String() string
type RepoSet ¶
RepoSet is a list of repos to match. It is a Sourcegraph addition and only used in the RPC interface for efficient checking of large repo lists.
func NewRepoSet ¶
type Substring ¶
type Substring struct { Pattern string CaseSensitive bool // Match only filename FileName bool // Match only content Content bool }
Substring is the most basic query: a query for a substring.