timing

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package timing reads when things fall (TAXONOMY.md D47, D48): a timing in its four forms, a target in its shapes, and a project's milestones as a chain of what waits on what. It is pure: the current month is the only thing it asks of the world.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MonthWords

func MonthWords(m string) string

MonthWords prints "2026-11" as "November 2026".

func Pending

func Pending(t Target) string

Pending says when a target that waits to be set is set, for a check's message.

func ThisMonth

func ThisMonth() string

ThisMonth is the current month as "YYYY-MM".

func TrimMonth

func TrimMonth(s string) string

TrimMonth is a date cut to its month, YYYY-MM.

Types

type Chain

type Chain struct {
	Names map[string]string
	Waits map[string][]string
	Loop  []string
}

Chain resolves a project's milestones (TAXONOMY.md D48): which waits on which (an after or set-when on another milestone of the project, or a waitsOn line), any loop, and the longest chain by the order of their months.

func Milestones

func Milestones(spec map[string]any) Chain

Milestones reads a project's milestones as a chain.

type Target

type Target struct {
	Value    float64
	HasValue bool
	// Month is the month it is due by, or for one set when an event
	// happens the month that is expected by; empty for one that follows
	// an event with no date of its own.
	Month string
	// Pending is a target set when an event happens.
	Pending bool
	Timing  Timing
	// Set is a target defined in any form; Dated is one that says when.
	Set, Dated bool
}

Target is a target in any of its shapes (TAXONOMY.md D47).

func ReadTarget

func ReadTarget(v any) Target

ReadTarget reads a target in any of its shapes.

type Timing

type Timing struct {
	Form string
	// Month is the latest month it can fall in, where it says one: the
	// date, a window's end (else its start), or the month a set-when is
	// expected by. Empty for after an event with no date of its own.
	Month string
	// Event is the event an after or a set-when waits on.
	Event map[string]any
	// Late is a set-when whose expected month has passed.
	Late bool
	// Complete is a timing that says everything its form needs.
	Complete bool
}

Timing is a timing read for the checks (TAXONOMY.md D47).

func Read

func Read(v any) Timing

Read reads a timing in any of its four forms.

Jump to

Keyboard shortcuts

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