query

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(
	rootDir string,
	filter func(compName string, root string) (matches bool, err error),
	creator comp.ComponentCreator,
	opts ...Option,
) (comps []*comp.Component, all []*comp.Component, err error)

Find finds all components in directory `root` and loads them. Some directories are by default ignored.

func FindByPatterns

func FindByPatterns(
	rootDir string,
	patterns []string,
	minCount int,
	creator comp.ComponentCreator,
) (comps []*comp.Component, all []*comp.Component, err error)

Find finds components in `rootDir` with names matched by `patterns`.

func FindInside

func FindInside(
	dir string,
	creator comp.ComponentCreator,
	opts ...Option,
) (*comp.Component, error)

Find the matching component inside directory `dir`. Note: Only `WithComponentConfigFilename` makes sense for `opts`.

Types

type Option

type Option func(opts *queryOptions) error

func WithComponentConfigFilename

func WithComponentConfigFilename(filename string) Option

WithComponentConfigFilename sets the components config filename to be used (default is `comp.ConfigFileName`).

func WithPathFilter

func WithPathFilter(filter fs.DirFilter) Option

WithPathFilter set a custom path filter.

func WithPathFilterDefault

func WithPathFilterDefault() Option

WithPathFilterDefault sets the default path filter if non it set.

Jump to

Keyboard shortcuts

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