lifecycle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package lifecycle expands an offset-based task template into concrete, dated tasks for one event.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOffset

func ParseOffset(s string) (int, error)

ParseOffset converts "-30d" / "-2w" into a duration in days.

Types

type Task

type Task struct {
	Title  string
	Due    time.Time
	Labels []string
	Body   string
}

func Expand

func Expand(t *Template, e *event.Event) ([]Task, error)

Expand filters tasks by event mode and resolves due dates, sorted by deadline (earliest first).

type Template

type Template struct {
	Tasks []TemplateTask `yaml:"tasks"`
}

func LoadTemplate

func LoadTemplate(path string) (*Template, error)

type TemplateTask

type TemplateTask struct {
	Title  string       `yaml:"title"`
	Due    string       `yaml:"due"` // e.g. "-30d", "-2w", "0d" (= event day)
	Labels []string     `yaml:"labels"`
	Modes  []event.Mode `yaml:"modes"` // empty = all modes
	Body   string       `yaml:"body"`
}

Jump to

Keyboard shortcuts

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