Documentation ¶
Index ¶
- type NotFoundError
- type Notebook
- func (n *Notebook) AddList(title string) (*ToDoList, error)
- func (n *Notebook) GetCompletedLists() []*ToDoList
- func (n *Notebook) GetList(id uuid.UUID) (*ToDoList, error)
- func (n *Notebook) GetLists() []*ToDoList
- func (n *Notebook) GetOpenLists() []*ToDoList
- func (n *Notebook) Identifier() string
- func (n *Notebook) Merge(other crdt.Mergeable) (crdt.Mergeable, error)
- func (n *Notebook) RemoveList(id uuid.UUID)
- type OrderValue
- type Service
- func (s *Service) ApplyListPatch(userID, listID uuid.UUID, patch string) (*Notebook, error)
- func (s *Service) CheckItem(userID, listID, itemID uuid.UUID) (*ToDoList, error)
- func (s *Service) Create(userID uuid.UUID) (*Notebook, error)
- func (s *Service) CreateList(userID uuid.UUID) (*ToDoList, error)
- func (s *Service) Fetch(userID uuid.UUID) (*Notebook, error)
- func (s *Service) Remove(id uuid.UUID) error
- func (s *Service) UncheckItem(userID, listID, itemID uuid.UUID) (*ToDoList, error)
- func (s *Service) Update(userID uuid.UUID, notebook *Notebook) (*Notebook, error)
- type Title
- type ToDoItem
- type ToDoList
- func (tdl *ToDoList) AddItem(title string) (uuid.UUID, error)
- func (tdl *ToDoList) CheckItem(id uuid.UUID) (uuid.UUID, error)
- func (tdl *ToDoList) GetItem(id uuid.UUID) (ToDoItem, error)
- func (tdl *ToDoList) GetItems() []ToDoItem
- func (tdl *ToDoList) GetOrderedItems(doneToBottom bool) []ToDoItem
- func (tdl *ToDoList) Identifier() string
- func (tdl *ToDoList) IsCompleted() bool
- func (tdl *ToDoList) Merge(other crdt.Mergeable) (crdt.Mergeable, error)
- func (tdl *ToDoList) MoveItem(id uuid.UUID, targetIndex int) error
- func (tdl *ToDoList) RemoveItem(id uuid.UUID)
- func (tdl *ToDoList) Rename(title string)
- func (tdl *ToDoList) String() string
- func (tdl *ToDoList) UncheckItem(id uuid.UUID) (uuid.UUID, error)
- type UnknownError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotFoundError ¶
NotFoundError indicates that a ToDoListItem with the given ID does not exist
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type Notebook ¶
func NewNotebook ¶
func (*Notebook) GetCompletedLists ¶
func (*Notebook) GetOpenLists ¶
func (*Notebook) Identifier ¶
func (*Notebook) RemoveList ¶
type OrderValue ¶
OrderValue represents an ordering value with its correspondent update timestamp
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ApplyListPatch ¶
func (*Service) UncheckItem ¶
type ToDoItem ¶
type ToDoItem struct { ID uuid.UUID Title string Checked bool OrderValue OrderValue }
ToDoItem representa a single task that needs to be done
func (*ToDoItem) Identifier ¶
Identifier returns the ID of the ToDoItem
type ToDoList ¶
ToDoList represents a whole list of ToDoItems
func (*ToDoList) AddItem ¶
AddItem creates a new ToDoItem object and adds it to the ToDoList it is called on
func (*ToDoList) CheckItem ¶
CheckItem checks the ToDoItem with the given id or returns a NotFoundError if no match could be found
func (*ToDoList) GetItem ¶
GetItem returns the ToDoItem matching the given id or returns a NotFoundError if no match could be found
func (*ToDoList) GetItems ¶
GetItems returns a slice with all ToDoItems that are in the liveSet but not in the tombstoneSet and are therefore considered active
func (*ToDoList) GetOrderedItems ¶
func (*ToDoList) Identifier ¶
Identifier returns the ID of the ToDoList
func (*ToDoList) IsCompleted ¶
func (*ToDoList) Merge ¶
Merge combines the current ToDoList with the one passed in as parameter or returns a CannotBeMerged error if the ToDoLists or their ToDoListItems cannot be merged (e.g. they have different IDs)
func (*ToDoList) MoveItem ¶
MoveItem moves the ToDoItem with the given id to the targeted index or returns a NotFoundError if no match could be found
func (*ToDoList) RemoveItem ¶
RemoveItem removes the ToDoItem with the given id from the ToDoList but won't return an error if no match could be found as it is the desired state
type UnknownError ¶
type UnknownError struct {
// contains filtered or unexported fields
}
UnknownError indicates an unhandled error from another library that gets wrapped
func (*UnknownError) Error ¶
func (e *UnknownError) Error() string
func (*UnknownError) Unwrap ¶
func (e *UnknownError) Unwrap() error