Documentation
¶
Overview ¶
Package search provides client-side repository searching.
This supports building an in-memory search index based on the contents of multiple repositories, and then using string matching or regular expressions to find matches.
Package search implements the search for charts in repos but extracts it into a package
so it can be reused and composed over Currently the helm search is implemented under the cmd dir which means that most of its options cant be used in a composite struct to build on top of them
Index ¶
- func SortScore(r []*Result)
- type Index
- func (i *Index) AddRepo(rname string, ind *repo.IndexFile, all bool)
- func (i *Index) All() []*Result
- func (i *Index) Search(term string, threshold int, regexp bool) ([]*Result, error)
- func (i *Index) SearchLiteral(term string, threshold int) []*Result
- func (i *Index) SearchRegexp(re string, threshold int) ([]*Result, error)
- type RepoOptions
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a searchable index of chart information.
func (*Index) All ¶
All returns all charts in the index as if they were search results.
Each will be given a score of 0.
func (*Index) Search ¶
Search searches an index for the given term.
Threshold indicates the maximum score a term may have before being marked irrelevant. (Low score means higher relevance. Golf, not bowling.)
If regexp is true, the term is treated as a regular expression. Otherwise, term is treated as a literal string.
func (*Index) SearchLiteral ¶
SearchLiteral does a literal string search (no regexp).
type RepoOptions ¶
type RepoOptions struct { Versions bool Regexp bool Devel bool Version string MaxColWidth uint RepoFile string RepoCacheDir string OutputFormat output.Format }
RepoOptions is the struct used to search, and stores the different options to filter and configure the output
func (*RepoOptions) Run ¶
func (o *RepoOptions) Run(logger log.Logger, args []string) error
Run searchs and prints the found charts based of the filters