events

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheAge

func CacheAge(cacheDir, typeID string) time.Duration

CacheAge returns the age of the cache file, or -1 if it doesn't exist.

func CheckUpcoming

func CheckUpcoming(evts []content.EventInstance, withinDays int) []content.EventInstance

CheckUpcoming returns events whose date is within the next N days.

func ExportICS

func ExportICS(evts []content.EventInstance, w io.Writer) error

ExportICS writes events in iCal format (RFC 5545) to w.

func ExportVCS

func ExportVCS(evts []content.EventInstance, w io.Writer) error

ExportVCS writes events in vCalendar 1.0 format (.vcs) to w.

func FetchKhoros

func FetchKhoros(boardID, typeID, defaultScope string, timeout time.Duration) ([]content.EventInstance, error)

func FetchRSS

func FetchRSS(rssURL, typeID, defaultScope string, timeout time.Duration) ([]content.EventInstance, error)

FetchRSS fetches an RSS feed and returns parsed EventInstances.

func FilterByLocation

func FilterByLocation(events []content.EventInstance, userLat, userLon float64, localRadius, regionalRadius int) []content.EventInstance

FilterByLocation filters events based on user location and scope-based radius thresholds.

func FormatHookMessage

func FormatHookMessage(upcoming []content.EventInstance) string

FormatHookMessage formats a terminal-friendly reminder for upcoming events.

func GoogleCalendarURL

func GoogleCalendarURL(e content.EventInstance) string

GoogleCalendarURL returns a URL that opens Google Calendar with the event pre-filled.

func LoadCache

func LoadCache(cacheDir, typeID string) ([]content.EventInstance, error)

LoadCache reads cached events for a given event type.

func MergeAndSort

func MergeAndSort(a, b []content.EventInstance) []content.EventInstance

MergeAndSort combines two event slices, deduplicates by ID, sorts by date ascending.

func OutlookWebURL

func OutlookWebURL(e content.EventInstance) string

OutlookWebURL returns a URL that opens Outlook Web with the event pre-filled.

func ParseKhoros

func ParseKhoros(data []byte, typeID, defaultScope string) ([]content.EventInstance, error)

func ParseRSS

func ParseRSS(data []byte, typeID, defaultScope string) ([]content.EventInstance, error)

ParseRSS parses RSS XML into EventInstances.

func Resolve

func Resolve(et content.EventType, cacheDir string, force bool) ([]content.EventInstance, error)

Resolve returns events for a remotely-sourced event type (RSS or Khoros). Checks cache freshness first; fetches live if stale; falls back to stale cache on failure. Pass force=true to bypass the TTL check (used by sync --force).

func SaveCache

func SaveCache(cacheDir, typeID string, evts []content.EventInstance) error

SaveCache writes events to the cache file for a given event type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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