discover

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package discover finds portable .gwdk files from source include patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSourceExcludes added in v0.13.0

func DefaultSourceExcludes() []string

DefaultSourceExcludes returns the default portable source exclude patterns.

func DefaultSourceIncludes added in v0.13.0

func DefaultSourceIncludes() []string

DefaultSourceIncludes returns the default portable source include patterns.

func Files

func Files(root string, includes, excludes []string) ([]string, error)

Files returns files under root that match at least one include pattern and no exclude pattern. Patterns use slash-separated paths and support **.

func FilesAndDirs added in v0.5.0

func FilesAndDirs(root string, includes, excludes []string) ([]string, []string, error)

FilesAndDirs returns matching files plus traversed, non-excluded directories under root. Directory paths are useful for polling callers that want to detect additions and removals without rewalking the tree on every tick.

func OutputExcludePattern added in v0.13.0

func OutputExcludePattern(root, outputDir string) string

OutputExcludePattern returns a project-relative exclusion for generated output inside root.

func SelectModules added in v0.13.0

func SelectModules(modules []gowdk.ModuleConfig, moduleNames []string) ([]gowdk.ModuleConfig, error)

SelectModules resolves explicit module names, or returns every configured module when no names are selected.

Types

type Selection added in v0.13.0

type Selection struct {
	Root     string
	Includes []string
	Excludes []string
}

Selection is one resolved, configured GOWDK source set.

func ConfiguredSelection added in v0.13.0

func ConfiguredSelection(config gowdk.Config, outputDir string, moduleNames []string, root string) (Selection, error)

ConfiguredSelection resolves project and module source rules into one reusable source selection.

func (Selection) Files added in v0.13.0

func (selection Selection) Files() ([]string, error)

Files returns the files in the selection.

func (Selection) FilesAndDirs added in v0.13.0

func (selection Selection) FilesAndDirs() ([]string, []string, error)

FilesAndDirs returns matching files and traversed, non-excluded directories.

func (Selection) Fingerprint added in v0.13.0

func (selection Selection) Fingerprint() string

Fingerprint returns a deterministic identity for the selection rules.

func (Selection) Matches added in v0.13.0

func (selection Selection) Matches(path string) bool

Matches reports whether path belongs to the configured source selection. The path does not need to exist, so editor overlays can use this for unsaved documents.

Jump to

Keyboard shortcuts

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