Documentation
¶
Index ¶
- func Find(rootDir string, creator comp.ComponentCreator, opts ...Option) (comps []*comp.Component, all []*comp.Component, err error)
- func FindByPatterns(rootDir string, patterns []string, minCount int, creator comp.ComponentCreator, ...) (comps []*comp.Component, all []*comp.Component, err error)
- func FindInside(dir string, creator comp.ComponentCreator, opts ...Option) (*comp.Component, error)
- type CompFilter
- type Option
- func WithCompDirFilter(f CompFilter, useAnd bool) Option
- func WithCompDirPatterns(incls []string, excls []string, useAnd bool) Option
- func WithCompDirPatternsCombined(patterns []string, useAnd bool) Option
- func WithComponentConfigFilename(filename string) Option
- func WithComponentDirSingle(compDir string, useAnd bool) Option
- func WithFindOptions(opts ...fs.FindOptions) Option
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 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
WithCompDirPatterns add a component filter based on name patterns.
func WithCompDirPatternsCombined ¶ added in v0.24.0
WithCompDirPatternsCombined is the same as WithCompDirPatterns but with exclude syntax `!<pattern>`.
func WithComponentConfigFilename ¶
WithComponentConfigFilename sets the components config filename to be used (default is `comp.ConfigFileName`).
func WithComponentDirSingle ¶ added in v0.24.0
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.