ls

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Include = true
	Exclude = false
)

Variables

View Source
var (
	Substring = QueryKind{false, false}
	Fuzzy     = QueryKind{true, false}
	Exact     = QueryKind{false, true}
	MaskK     = QueryKind{true, true}
)

Functions

func Dir

func Dir(opts ...Option) (tr *lfs.FSTraverser)

func Do

func Do(prs ...Process) (res []*lfs.Element)

func NoHide

func NoHide(opts *lfs.FSTraverser) *lfs.FSTraverser

func NoneFilter

func NoneFilter(*lfs.Element) bool

func NoneProcess

func NoneProcess(els []*lfs.Element) []*lfs.Element

func Recurse

func Recurse(opts *lfs.FSTraverser) *lfs.FSTraverser

func SetGlobalLogger

func SetGlobalLogger(l common.Logger)

Types

type Filter

type Filter func(*lfs.Element) bool

func ExactFilter

func ExactFilter(search string) Filter

func MaskFilter

func MaskFilter(mask uint32) Filter

func ParseKind

func ParseKind(args []string, inc bool) Filter

func ParseSearch

func ParseSearch(args []string) Filter

func QueryAsFilter

func QueryAsFilter(qr ...string) Filter

func SubstringFilter

func SubstringFilter(search string) Filter

type Option

type Option func(*lfs.FSTraverser) *lfs.FSTraverser

func DepthPattern

func DepthPattern(pat string) Option

func FromDepth

func FromDepth(depth int) Option

func LogWith

func LogWith(logger *slog.Logger) Option

func Masks

func Masks(inc bool, masks ...uint32) Option

func Paths

func Paths(paths ...string) Option
func Search(queries ...string) Option

func ToDepth

func ToDepth(depth int) Option

type Process

type Process func(inp []*lfs.Element) (out []*lfs.Element)

func Combine

func Combine(trs ...*lfs.FSTraverser) Process

func SliceProcess

func SliceProcess(pattern string) Process

func Sort

func Sort(by lfs.SortBy) Process

func TimeSlice

func TimeSlice(pattern string) Process

type Query

type Query struct {
	Value   string
	Include bool
	Mask    uint32
	Kind    QueryKind
}

func (Query) GetFilter

func (q Query) GetFilter() (f Filter)

type QueryKind

type QueryKind [2]bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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