artifactsyntax

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package artifactsyntax parses ArtifactGenerator selectors and capture templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompilePathPattern

func CompilePathPattern(pattern string) (*regexp.Regexp, error)

CompilePathPattern matches whole directory paths and names their captures.

func ScanTemplate

func ScanTemplate(template string, visit func(literal, capture string) error) (string, error)

ScanTemplate returns the capture at a grammar error so callers can report field-specific errors.

Types

type Selector

type Selector struct {
	Text    string
	Alias   string
	Path    string
	Marked  bool
	HasPath bool
}

Selector retains the authored text, with its alias and optional path.

func ParseSelector

func ParseSelector(text string) Selector

ParseSelector interprets a selector without applying field-specific rules.

func (Selector) StagedFile

func (s Selector) StagedFile() bool

StagedFile reports whether a file selector reads from the composed output.

type Token

type Token struct {
	Literal string
	Capture int
}

Token uses a one-based capture index so zero denotes a literal.

func Tokens

func Tokens(template string, captures []string, tokens []Token, declare bool) ([]Token, []string, error)

Tokens binds template captures in declaration order or against an existing capture list.

Jump to

Keyboard shortcuts

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