yearcycle

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package yearcycle loads recurring events from an iCal feed and projects them onto a single canonical year for cyclic visualization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyFromTitle

func KeyFromTitle(title string) string

KeyFromTitle derives a stable lookup key from a title string. "DPIA Review" → "dpia-review"

Types

type Event

type Event struct {
	// Key is a stable lookup identifier derived from the SUMMARY, e.g.
	// "dpia-review". Controls reference this key instead of raw calendar UIDs.
	Key string
	// Title is the human-readable event title (SUMMARY).
	Title string
	// Month is the 1-based month in which the event occurs (1 = January).
	Month time.Month
	// Day within the month.
	Day int
	// Frequency describes the recurrence: "monthly", "quarterly", "yearly", etc.
	Frequency string
	// CalendarURL links to the source calendar entry (if available).
	CalendarURL string
}

Event is a single recurring activity projected onto one canonical year.

type YearCycle

type YearCycle struct {
	// Title for the calendar source.
	Title string
	// CalendarURL is the public URL of the iCal feed.
	CalendarURL string
	// Events projected onto a single year, sorted by month then day.
	Events []Event
}

YearCycle is the full set of recurring events for one calendar source.

func Load

func Load(source, title string) (*YearCycle, error)

Load reads an iCal feed from a URL or local file path, extracts recurring events, and projects them onto a canonical year.

func Parse

func Parse(r io.Reader, title, calendarURL string) (*YearCycle, error)

Parse reads an iCal stream and returns a YearCycle.

func (*YearCycle) ExpandAll

func (yc *YearCycle) ExpandAll() []Event

ExpandAll expands recurring events across the year.

func (*YearCycle) LookupByKey

func (yc *YearCycle) LookupByKey(key string) *Event

LookupByKey returns the first event matching the given key, or nil.

Jump to

Keyboard shortcuts

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