label

package
v1.15.16 Latest Latest
Warning

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

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

Documentation

Overview

Package label handles part label files

Index

Constants

View Source
const (
	// LabelsFilename is the name of the labels marker file.
	LabelsFilename = ".labels.yaml"
	// LabelsFilenameLegacy is the old (ace-dt version<=0.25.4) name of the labels marker file.
	LabelsFilenameLegacy = ".labels.yml"
)

Variables

This section is empty.

Functions

func HasSubparts

func HasSubparts(fsys fs.FS, pth string) (bool, error)

HasSubparts returns true if the path has subparts, error if there was an IO error subparts are indicated by the existence of a labels file.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is a label provider, keeping track of file label associations in a nested directory structure.

func NewProviderFromFS

func NewProviderFromFS(fsys fs.FS) (*Provider, error)

NewProviderFromFS loads all labels from .labels.yaml files found in the specified basePath and subdirs, recursively. if a directory does not contain a ".labels.yaml" file, recursion stops for that path.

func (*Provider) LabelsForPart

func (p *Provider) LabelsForPart(partName string) labels.Set

LabelsForPart returns the labels for a given part by name.

func (*Provider) Save

func (p *Provider) Save(basePath string) error

Save writes the label provider label data to yaml files located at the file paths used as the path keys.

func (*Provider) SetLabels

func (p *Provider) SetLabels(partName string, lbls map[string]string)

SetLabels sets all the labels on a part.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳