query

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(
	rootDir string,
	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,
	opts ...Option,
) (comps []*comp.Component, all []*comp.Component, err error)

FindByPatterns 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 CompFilter added in v0.24.0

type CompFilter func(_compName, _root string) (_matches bool)

type Option

type Option func(opts *queryOptions) error

func WithCompDirFilter added in v0.24.0

func WithCompDirFilter(f CompFilter, useAnd bool) Option

WithCompDirFilter combines a component filter.

func WithCompDirPatterns added in v0.24.0

func WithCompDirPatterns(incls []string, excls []string, useAnd bool) Option

WithCompDirPatterns add a component filter based on name patterns.

func WithCompDirPatternsCombined added in v0.24.0

func WithCompDirPatternsCombined(patterns []string, useAnd bool) Option

WithCompDirPatternsCombined is the same as WithCompDirPatterns but with exclude syntax `!<pattern>`.

func WithComponentConfigFilename

func WithComponentConfigFilename(filename string) Option

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

func WithComponentDirSingle added in v0.24.0

func WithComponentDirSingle(compDir string, useAnd bool) Option

WithComponentDirSingle returns a simple filter which only returns the component with root directory `compDir`.

func WithFindOptions added in v0.24.0

func WithFindOptions(opts ...fs.FindOptions) Option

WithFindOptions sets fs.FindOptions for the search over the directories.

Jump to

Keyboard shortcuts

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