query

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindUnique

func FindUnique(idx *index.Index, query string) (*index.Repo, []*index.Repo, error)

FindUnique attempts to find a unique repository matching the query Returns the repo if unique match found, nil if no match, error if ambiguous

func Query

func Query(idx *index.Index, filter *Filter) []*index.Repo

Query executes a query against the index

Types

type Filter

type Filter struct {
	SearchTerms []string // Fuzzy search terms
	Languages   []string // Exact language matches
	Tags        []string // All tags must match
	Branch      string   // Exact branch match
	Root        string   // Exact root match
	Dirty       *bool    // nil = no filter, true = dirty only, false = clean only
	Ahead       *bool    // nil = no filter, true = ahead only
	Behind      *bool    // nil = no filter, true = behind only
	SortBy      SortField
	Limit       int
}

Filter represents query filters

type SortField

type SortField int

SortField represents a field to sort by

const (
	SortByName SortField = iota
	SortByLastCommit
	SortByPath
	SortByLastScan
)

Jump to

Keyboard shortcuts

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