badge

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	Label string
	Value string
	Color string
}

Badge is an evaluated badge ready for display.

func Evaluate

func Evaluate(workDir string, rules []Rule) []Badge

Evaluate runs all badge rules against a working directory. Rules that fail (missing file, bad JSON path) are silently skipped.

type Rule

type Rule struct {
	Path     string `yaml:"path"`      // file path relative to working dir
	JSONPath string `yaml:"json_path"` // dot-separated path into JSON (optional)
	Label    string `yaml:"label"`     // display label
	Color    string `yaml:"color"`     // hex color (optional)
}

Rule defines how to extract a badge value from a project file.

Jump to

Keyboard shortcuts

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