Documentation
¶
Overview ¶
Package core provides shared reminder types and storage operations used by all remind subcommand packages. Subcommands import core, never each other.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NextID ¶
NextID returns the next available reminder ID (max existing + 1).
Parameters:
- reminders: Existing reminders to scan
Returns:
- int: The next sequential ID
func RemindersPath ¶
func RemindersPath() string
RemindersPath returns the full path to the reminders JSON file.
Returns:
- string: Absolute path to reminders.json
func WriteReminders ¶
WriteReminders writes all reminders to the JSON file.
Parameters:
- reminders: The reminder slice to persist
Returns:
- error: Non-nil on marshal or write failure
Types ¶
type Reminder ¶
type Reminder struct {
ID int `json:"id"`
Message string `json:"message"`
Created string `json:"created"`
After *string `json:"after"` // nullable YYYY-MM-DD
}
Reminder represents a single session-scoped reminder.
func ReadReminders ¶
ReadReminders reads all reminders from the JSON file.
Returns:
- []Reminder: The parsed reminders (nil when file absent)
- error: Non-nil on read or parse failure
Click to show internal directories.
Click to hide internal directories.