internal

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CandidateMetaLabel    = "label"
	CandidateMetaKind     = "kind"
	CandidateMetaPath     = "path"
	CandidateMetaName     = "name"
	CandidateMetaFullName = "full_name"
	CandidateMetaSSHURL   = "ssh_url"
	CandidateMetaSource   = "source"

	CandidateSourceLocal  = "local"
	CandidateSourceRemote = "remote"
	CandidateSourceZoxide = "zoxide"

	CandidateSignalZoxideScore = "source.zoxide.score"
)
View Source
const (
	CloneToCWDFlag     = "-c"
	CloneToCWDLongFlag = "--cwd"
	Usage              = "usage: fly [query] | fly -c [query] | fly init | fly refresh | fly track"
)

Variables

View Source
var ErrNoReposTracked = errors.New("no repos tracked yet")
View Source
var ErrUnsupportedCandidate = errors.New("unsupported candidate")

Functions

func CacheDir

func CacheDir(appName string) (string, error)

func CheckDestination

func CheckDestination(dest string) (bool, error)

func ConfigDir

func ConfigDir(appName string) (string, error)

func DataDir

func DataDir(appName string) (string, error)

func Find

func Find(path string) (string, bool, error)

func Pick

func Pick(query string, candidates []Candidate, options ...picker.Option) (int, bool, error)

func Run

func Run(args []string, stdout io.Writer, stderr io.Writer, deps CliDependencies) error

func WriteFile

func WriteFile(path string, data []byte, perm os.FileMode) error

func ZshInitSnippet

func ZshInitSnippet() string

Types

type App

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

func NewApp

func NewApp(sources []Source, sourceOptions ...Option) (*App, error)

func (*App) Prune

func (a *App) Prune() error

func (*App) Query

func (a *App) Query(ctx context.Context, query string, stdout io.Writer) error

func (*App) Refresh

func (a *App) Refresh(ctx context.Context) error

func (*App) Track

func (a *App) Track(repoPath string) error

type Candidate

type Candidate struct {
	Signals map[string]float64
	Meta    map[string]string
	// contains filtered or unexported fields
}

type CliDependencies

type CliDependencies struct {
	Init    func(io.Writer) error
	Refresh func() error
	Prune   func() error
	Track   func() error
	Query   func(string, io.Writer) error
}

type Cloner

type Cloner interface {
	Clone(Repo) (string, error)
}

type ClonerFunc

type ClonerFunc func(Repo) (string, error)

func (ClonerFunc) Clone

func (f ClonerFunc) Clone(repo Repo) (string, error)

type Entry

type Entry struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type Option added in v0.1.4

type Option func(*options) error

func WithPicker added in v0.1.4

func WithPicker(picker Picker) Option

type Picker

type Picker interface {
	Pick(string, []Candidate) (int, bool, error)
}

type PickerFunc

type PickerFunc func(string, []Candidate) (int, bool, error)

func (PickerFunc) Pick

func (f PickerFunc) Pick(query string, candidates []Candidate) (int, bool, error)

type Prunable added in v0.1.4

type Prunable interface {
	Prune() error
}

type Pruner added in v0.1.4

type Pruner interface {
	Launch()
}

type PrunerFunc added in v0.1.4

type PrunerFunc func()

func (PrunerFunc) Launch added in v0.1.4

func (f PrunerFunc) Launch()

type Refreshable added in v0.1.4

type Refreshable interface {
	Refresh(context.Context) error
}

type Refresher added in v0.1.4

type Refresher interface {
	Launch()
}

type RefresherFunc added in v0.1.4

type RefresherFunc func()

func (RefresherFunc) Launch added in v0.1.4

func (f RefresherFunc) Launch()

type Repo

type Repo struct {
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	SSHURL   string `json:"ssh_url"`
}

type Runner

type Runner interface {
	Run(ctx context.Context, name string, args ...string) ([]byte, error)
}

type RunnerFunc

type RunnerFunc func(context.Context, string, ...string) ([]byte, error)

func (RunnerFunc) Run

func (f RunnerFunc) Run(ctx context.Context, name string, args ...string) ([]byte, error)

type Source added in v0.1.4

type Source interface {
	Load(context.Context, string) ([]Candidate, error)
	Resolve(Candidate) (string, error)
}

type Trackable added in v0.1.4

type Trackable interface {
	Track(string) error
}

Directories

Path Synopsis
matchers/orderedchars
Package orderedchars matches when all query characters appear in order.
Package orderedchars matches when all query characters appear in order.
matchers/substring
Package substring matches when the query exists as a contiguous substring.
Package substring matches when the query exists as a contiguous substring.
sorters/minipick
Package minipick sorts matches by width and start position.
Package minipick sorts matches by width and start position.
sorters/most_adjacent
Package most_adjacent sorts matches by their most contiguous match span.
Package most_adjacent sorts matches by their most contiguous match span.
sources

Jump to

Keyboard shortcuts

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