match

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuzzyMatcher

type FuzzyMatcher struct{}

func (*FuzzyMatcher) Match

func (m *FuzzyMatcher) Match(pattern string, candidates []string) []Match

type GlobMatcher

type GlobMatcher struct{}

func (*GlobMatcher) Match

func (m *GlobMatcher) Match(pattern string, candidates []string) []Match

type Match

type Match struct {
	Index         int
	Score         int
	MatchedRanges []Range
}

type Matcher

type Matcher interface {
	Match(pattern string, candidates []string) []Match
}

func New

func New(mode Mode) Matcher

type Mode

type Mode int
const (
	ModeFuzzy Mode = iota
	ModeRegex
	ModeGlob
)

func ParseMode

func ParseMode(s string) (Mode, bool)

func (Mode) Next

func (m Mode) Next(enabled []Mode) Mode

func (Mode) String

func (m Mode) String() string

type Range

type Range struct {
	Start int
	End   int
}

type RegexMatcher

type RegexMatcher struct{}

func (*RegexMatcher) Match

func (m *RegexMatcher) Match(pattern string, candidates []string) []Match

Jump to

Keyboard shortcuts

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