planning

package
v0.107.35 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package planning owns persistent calendars and tasks shared by all backend clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID

func ID() string

Types

type Item

type Item = map[string]any

type Mutation

type Mutation struct {
	RequestID        string  `json:"requestId"`
	Action           string  `json:"action"`
	ID               string  `json:"id,omitempty"`
	ExpectedRevision *uint64 `json:"expectedRevision,omitempty"`
	Data             Item    `json:"data"`
}

type Result

type Result struct {
	Status   string `json:"status"`
	Seq      uint64 `json:"seq"`
	Item     any    `json:"item"`
	Replayed bool   `json:"replayed"`
	Message  string `json:"message,omitempty"`
}

type Snapshot

type Snapshot struct {
	Seq            uint64 `json:"seq"`
	TimeZone       string `json:"timeZone"`
	Calendars      []Item `json:"calendars"`
	Todos          []Item `json:"todos"`
	Groups         []Item `json:"groups"`
	Tags           []Item `json:"tags"`
	Events         []Item `json:"events"`
	EventMasters   []Item `json:"eventMasters,omitempty"`
	TodoSchedules  []Item `json:"todoSchedules"`
	Reminders      []Item `json:"reminders"`
	Sources        []Item `json:"sources"`
	Subscriptions  []Item `json:"subscriptions"`
	DefaultGroupID string `json:"defaultGroupId,omitempty"`
	MyTasksColor   string `json:"myTasksColor,omitempty"`
}

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) Claim

func (s *Store) Claim() ([]Item, error)

Claim leases due notifications so multiple desktop clients cannot deliver the same reminder.

func (*Store) Finish

func (s *Store) Finish(in Item) (any, error)

func (*Store) Import

func (s *Store) Import(in Snapshot, source string, subscriptions []Item) (Item, error)

func (*Store) Mutate

func (s *Store) Mutate(m Mutation) (Result, error)

func (*Store) Query

func (s *Store) Query(from, to int64) (Snapshot, error)

func (*Store) Run

func (s *Store) Run(ctx context.Context)

func (*Store) SetTimeZone

func (s *Store) SetTimeZone(zone string) (any, error)

func (*Store) Subscription

func (s *Store) Subscription(action string, input Item) (any, error)

func (*Store) TimeZoneSettings

func (s *Store) TimeZoneSettings() Item

func (*Store) UpdateTimeZone

func (s *Store) UpdateTimeZone(preference string, expected *uint64) (any, error)

Jump to

Keyboard shortcuts

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