scale

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Priority = Scale{Axis: "priority", Names: []string{"Urgent", "High", "Medium", "Low"}, None: 5, /* contains filtered or unexported fields */}
	Effort   = Scale{Axis: "effort", Names: []string{"Low", "Medium", "High"}, None: 2, /* contains filtered or unexported fields */}
)

The two scales (ADR-0040, "Two axes, the forge's levels, read by name").

View Source
var Own = own()

Own is workline's own priority labels, workline:priority/1, the most pressing, to /4, the most pressing the warmest: the family the role writes until ADR-0040's detection finds a project's.

Used is the scheme the engine reads and writes issues with: workline's own priority labels; no effort, read nowhere until ADR-0040's grid.

Functions

func Said

func Said(l int) string

Said is a priority level in a sentence: "priority 2"; "no priority" for none.

func Value

func Value(l int) string

Value is a priority level as the role's texts say it: its number, 1 the most pressing, as workline's own labels write it; "none" for none.

func Weight

func Weight(w int) int

Weight is the effort level of a GitLab weight, a whole number: 0 or 1 Low, 2 or 3 Medium, 4 or more High; none for a weight below 0.

func WeightOf

func WeightOf(l int) int

WeightOf is the weight written for an effort level: 1, 3 or 5, on both common point scales (1, 2, 3, 5, 8 and 1 to 5); 0 for none.

Types

type Family

type Family struct {
	Scale  Scale
	Prefix string
	Labels []Label
}

Family is where a project keeps an axis: labels that carry its levels, each read by its name, or a field's options. Prefix starts each label of a family of labels; "" for a field's options. Its labels are in the order of their levels: the first of a level is the one written.

func Labels

func Labels(s Scale, prefix string, labels []string) (Family, error)

Labels reads a project's family of labels by name: each label starting with prefix, its rest a number or a word. Numbers count from the family's own start, 0 when it has a 0, else 1 (Scale.Number): a family created a label at a time, its first label never made, still reads its second as the second level. A prefix ending in a letter or a digit takes numbers only — P0, effort1: hours —, so P-critical belongs to another family and Performance to none. A word no table knows carries no level, and the error names it, to be said once.

func Options

func Options(s Scale, options []string) (Family, error)

Options reads a field's options by name, never by their position: a forge lists them as its owner arranged them, an Effort field heaviest first. An option no table knows carries no level, and the error names it, to be said once.

func (Family) First

func (f Family) First(names []string) int

First is the first level in the order's direction names carry — the most pressing priority, the lightest effort —; 0 when they carry none.

func (Family) Label

func (f Family) Label(l int) (Label, bool)

Label is the label written for level l: the family's first carrying it; ok is false when none does.

func (Family) Levels

func (f Family) Levels(names []string) []int

Levels are the levels names carry in the family, in the names' order; a name outside it carries none.

func (Family) Of

func (f Family) Of(name string) int

Of is the level a name of the family carries; 0 when it carries none.

func (Family) Others

func (f Family) Others(l int) []string

Others are the family's names but the one written for level l: those taken off when it is set.

type Label

type Label struct {
	Name  string
	Level int
	Color string
	About string
}

Label is one name of a family and the level it carries. Color and About, for a label the role creates: its colour and what it says of itself.

func (Label) Describe

func (l Label) Describe(by string) string

Describe is what a label the role creates says of itself, by the role named.

type Scale

type Scale struct {
	Axis  string
	Names []string
	// None is where an issue with no value ranks: after the last
	// priority; an effort not estimated as the middle one.
	None int
	// contains filtered or unexported fields
}

Scale is an axis's levels in the order's direction: level 1 is the first name, the most pressing priority or the lightest effort, the last name the last level; 0 is none.

func (Scale) Count

func (s Scale) Count() int

Count is the scale's number of levels.

func (Scale) Name

func (s Scale) Name(l int) string

Name is a level's name; "" for none.

func (Scale) Number

func (s Scale) Number(n, first int) int

Number is the level of the number n in a family numbered from first, 0 or 1: first is the first level, each next number the next one, every number past the last level the last (P0 to P5: Urgent, High, Medium, then Low thrice); 0 below first.

func (Scale) Rank

func (s Scale) Rank(l int) int

Rank is where a level sorts: the level itself, or None for none.

func (Scale) Valid

func (s Scale) Valid(l int) bool

Valid says whether l is one of the scale's levels.

func (Scale) Word

func (s Scale) Word(name string) (int, bool)

Word is the level a word names, whatever its case: a level's own name, or one a project or a forge uses for it (critical, small, weeks); ok is false when no table knows it.

type Scheme

type Scheme struct {
	Priority Family
	Effort   Family
}

Scheme is where the engine reads each axis on a project.

Jump to

Keyboard shortcuts

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