milestone

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProgressBar

func ProgressBar(done, total, width int) string

ProgressBar renders an ASCII progress bar. Format: [████████░░░░░░░░] 50% (4/8) width is the number of bar characters (default 20 if <= 0).

func SlugFromTitle

func SlugFromTitle(title string) string

SlugFromTitle converts a title to a valid milestone ID.

func Validate

func Validate(m *Milestone) error

func ValidateID

func ValidateID(id string) error

func Write

func Write(m *Milestone, path string) error

Types

type Milestone

type Milestone struct {
	ID          string `yaml:"id"`
	Title       string `yaml:"title"`
	Description string `yaml:"description,omitempty"`
	DueDate     string `yaml:"due_date,omitempty"`
	State       string `yaml:"state"`
	CreatedAt   string `yaml:"created_at"`
	ClosedAt    string `yaml:"closed_at,omitempty"`
	Body        string `yaml:"-"`
}

func ListMilestones

func ListMilestones(milestonesPath string) ([]*Milestone, error)

func Parse

func Parse(content []byte) (*Milestone, error)

func ParseFile

func ParseFile(path string) (*Milestone, error)

type ProgressInfo

type ProgressInfo struct {
	TotalTickets  int
	DoneTickets   int
	TotalPoints   int
	DonePoints    int
	DaysRemaining int // negative = overdue; 0 = due today; math.MaxInt if no due date
	IsOverdue     bool
	HasDueDate    bool
}

ProgressInfo holds computed progress metrics for a milestone.

func CalculateProgress

func CalculateProgress(tickets []TicketSummary, dueDate string, doneStates []string) ProgressInfo

CalculateProgress computes progress metrics from a list of ticket summaries and an optional due date string ("YYYY-MM-DD" or "").

type TicketSummary

type TicketSummary struct {
	Status string
	Points int
}

TicketSummary is the minimal ticket data needed for progress calculation.

Jump to

Keyboard shortcuts

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