input

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDir

type BaseDir string

func (BaseDir) TrimOffFrom

func (in BaseDir) TrimOffFrom(absPath string) (string, bool)

TrimOffFrom returns if the base directory can be trimmed of from `absPath`.

type Config

type Config struct {
	ID ID `yaml:"-"`

	// Regex patterns:
	// Prefixed with `!` denotes a exclude pattern.
	// Escaping for a first `!` can be done with `\!`.
	Patterns []string `yaml:"patterns" validate:"required"`

	// If the regex match (`BaseDir`) against the root directory
	// or the components root dir.
	RelativeToRoot bool   `yaml:"relToRoot"`
	BaseDir        string `yaml:"-"`
	// contains filtered or unexported fields
}

func (*Config) Excludes

func (in *Config) Excludes() []string

Exclude returns exclude patterns.

func (*Config) Includes

func (in *Config) Includes() []string

Includes returns include patterns.

func (*Config) Init

func (in *Config) Init(id ID)

Init initializes this config.

func (*Config) SplitIntoIncludeAndExcludes

func (in *Config) SplitIntoIncludeAndExcludes()

SplitIntoIncludeAndExcludes splits the patterns into include and exclude patterns.

func (*Config) TrimOfBaseDir

func (in *Config) TrimOfBaseDir(absPath string) (relativePath string, trimmed bool)

TrimOfBaseDir returns if the `BaseDir` could be trimmed of (its match).

type ID

type ID string

func DefineID

func DefineID(componentName string, inputName string) ID

DefineID defines the input id, based on the component name and the input name.

func DefineIDComp

func DefineIDComp(componentName string) ID

func (ID) IsComponent

func (i ID) IsComponent() bool

IsComponent tells if this input id refers to the whole component instead of to an input set on the component. TODO: Wrap into better types (also 'comp://subdir' would be possible, maybe not needed).

Jump to

Keyboard shortcuts

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