reminders

package
v0.0.0-...-f32d4c8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reminders stores the current system Reminders mirror, scoped by source.

Index

Constants

View Source
const (
	SchemaVersion = 1
	UploadLimit   = 16 << 20
	RecordLimit   = 64 << 10
	StoreLimit    = 128 << 20
	MaxItems      = 20000
)

Variables

View Source
var ErrNotFound = errors.New("reminder is not in the current mirror")

Functions

func RecordID

func RecordID(source, id string) string

func ValidDate

func ValidDate(value string) bool

Types

type Due

type Due struct {
	Date     string  `json:"date"`
	Time     *string `json:"time"`
	TimeZone *string `json:"timeZone"`
}

type Entry

type Entry struct {
	Summary
	SourceID  string   `json:"sourceId"`
	RecordID  string   `json:"recordId"`
	File      string   `json:"file"`
	SourceIDs []string `json:"sourceIds,omitempty"`
}

type Index

type Index struct {
	SchemaVersion int     `json:"schemaVersion"`
	Revision      string  `json:"revision"`
	Items         []Entry `json:"items"`
}

type Item

type Item struct {
	Summary
	Notes      *string `json:"notes"`
	URL        *string `json:"url"`
	CreatedAt  *string `json:"createdAt"`
	ModifiedAt *string `json:"modifiedAt"`
}

type Payload

type Payload struct {
	SchemaVersion int    `json:"schemaVersion"`
	SourceID      string `json:"sourceId"`
	CollectedAt   string `json:"collectedAt"`
	Items         []Item `json:"items"`
}

func Decode

func Decode(raw []byte) (Payload, error)

Decode rejects an incomplete snapshot before it can replace a source mirror. Missing/null items is different from a successfully fetched empty array.

type Record

type Record struct {
	Item
	SourceID  string   `json:"sourceId"`
	RecordID  string   `json:"recordId"`
	SourceIDs []string `json:"sourceIds,omitempty"`
}

type Result

type Result struct {
	Changed  bool   `json:"-"`
	OK       bool   `json:"ok"`
	Applied  bool   `json:"applied"`
	Ingested int    `json:"ingested"`
	Revision string `json:"revision"`
}

type SourceState

type SourceState struct {
	LastCollectedAt string `json:"lastCollectedAt"`
}

type State

type State struct {
	SchemaVersion      int                    `json:"schemaVersion"`
	Sources            map[string]SourceState `json:"sources"`
	ContentCollectedAt map[string]string      `json:"contentCollectedAt,omitempty"`
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(dir string) *Storage

func (*Storage) Replace

func (s *Storage) Replace(p Payload) (Result, error)

func (*Storage) View

func (s *Storage) View(fn func(Index, State, func(string) (Record, error)) error) error

View keeps index, sync metadata and the optional detail on one committed view. A failed/interrupted multi-file replacement is recovered before any read.

type Summary

type Summary struct {
	ID          string  `json:"id"`
	Title       string  `json:"title"`
	ListID      string  `json:"listId"`
	ListName    string  `json:"listName"`
	Due         *Due    `json:"due"`
	IsCompleted bool    `json:"isCompleted"`
	CompletedAt *string `json:"completedAt"`
	Priority    int     `json:"priority"`
	IsRecurring bool    `json:"isRecurring"`
}

Jump to

Keyboard shortcuts

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