defaults

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package defaults provides embedded default configuration for gh-pmu.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Terms added in v0.16.0

func Terms() string

Terms returns the embedded terms and conditions text.

Types

type Defaults

type Defaults struct {
	Labels []LabelDef `yaml:"labels"`
	Fields FieldsDef  `yaml:"fields"`
}

Defaults holds the parsed default configuration.

func Load

func Load() (*Defaults, error)

Load parses and returns the embedded defaults.

func MustLoad

func MustLoad() *Defaults

MustLoad parses and returns the embedded defaults, panicking on error.

func (*Defaults) GetLabel added in v0.13.1

func (d *Defaults) GetLabel(name string) *LabelDef

GetLabel returns the label definition for a given name, or nil if not found.

func (*Defaults) GetLabelNames added in v0.13.5

func (d *Defaults) GetLabelNames() []string

GetLabelNames returns a slice of all standard label names.

func (*Defaults) IsStandardLabel added in v0.13.5

func (d *Defaults) IsStandardLabel(name string) bool

IsStandardLabel returns true if the given label name is a standard label.

type FieldDef

type FieldDef struct {
	Name    string   `yaml:"name"`
	Type    string   `yaml:"type"`
	Options []string `yaml:"options,omitempty"`
}

FieldDef represents a project field definition.

type FieldsDef

type FieldsDef struct {
	Required        []FieldDef `yaml:"required"`
	CreateIfMissing []FieldDef `yaml:"create_if_missing"`
}

FieldsDef holds field definitions separated by requirement level.

type LabelDef

type LabelDef struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Color       string `yaml:"color"`
}

LabelDef represents a label definition.

Jump to

Keyboard shortcuts

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