search

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFlags

func NewFlags() []cli.Flag

NewFlags generates command line flags to configure the search.

func NewOptions

func NewOptions(c *cli.Context) *walk.Options

NewOptions search options from command line arguments

Types

type ErrNotFound

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

ErrNotFound is emitted when the project dir tree search is finished but no matching files are found.

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

func (ErrNotFound) ExitCode

func (e ErrNotFound) ExitCode() int

ExitCode returns the analyzer CLI application exit code which should be returned upon analyzer termination when ErrNotFound occurs.

type MatchFunc

type MatchFunc func(path string, info os.FileInfo) (bool, error)

MatchFunc is the interface of match functions.

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

Search implements a search.

func New

func New(mf MatchFunc, opts *walk.Options) *Search

New returns a new Search initialized with given matching function and options.

func (Search) Run

func (s Search) Run(searchPath string) (string, error)

Run performs a search on given path and returns matching path, otherwise an error.

Jump to

Keyboard shortcuts

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