Documentation
¶
Index ¶
- Constants
- type Album
- func (a *Album) GetCreatedAt() time.Time
- func (a *Album) GetID() int64
- func (a *Album) GetTableName() string
- func (a *Album) GetUpdatedAt() time.Time
- func (a *Album) HasRating() bool
- func (a *Album) IsValidRating() bool
- func (a *Album) MarshalTracks() (string, error)
- func (a *Album) SetCreatedAt(time time.Time)
- func (a *Album) SetID(id int64)
- func (a *Album) SetUpdatedAt(time time.Time)
- func (a *Album) UnmarshalTracks(data string) error
- type Article
- func (a *Article) GetCreatedAt() time.Time
- func (a *Article) GetID() int64
- func (a *Article) GetTableName() string
- func (a *Article) GetUpdatedAt() time.Time
- func (a *Article) HasAuthor() bool
- func (a *Article) HasDate() bool
- func (a *Article) IsValidURL() bool
- func (a *Article) SetCreatedAt(time time.Time)
- func (a *Article) SetID(id int64)
- func (a *Article) SetUpdatedAt(time time.Time)
- type Book
- func (b *Book) GetCompletionTime() *time.Time
- func (b *Book) GetCreatedAt() time.Time
- func (b *Book) GetID() int64
- func (b *Book) GetProgress() int
- func (b *Book) GetStatus() string
- func (b *Book) GetTableName() string
- func (b *Book) GetUpdatedAt() time.Time
- func (b *Book) IsCompleted() bool
- func (b *Book) IsFinished() bool
- func (b *Book) IsQueued() bool
- func (b *Book) IsReading() bool
- func (b *Book) ProgressPercent() int
- func (b *Book) SetCreatedAt(time time.Time)
- func (b *Book) SetID(id int64)
- func (b *Book) SetProgress(progress int) error
- func (b *Book) SetUpdatedAt(time time.Time)
- func (b *Book) ValidStatuses() []string
- type Completable
- type Model
- type Movie
- func (m *Movie) GetCompletionTime() *time.Time
- func (m *Movie) GetCreatedAt() time.Time
- func (m *Movie) GetID() int64
- func (m *Movie) GetStatus() string
- func (m *Movie) GetTableName() string
- func (m *Movie) GetUpdatedAt() time.Time
- func (m *Movie) IsCompleted() bool
- func (m *Movie) IsQueued() bool
- func (m *Movie) IsWatched() bool
- func (m *Movie) SetCreatedAt(time time.Time)
- func (m *Movie) SetID(id int64)
- func (m *Movie) SetUpdatedAt(time time.Time)
- func (m *Movie) ValidStatuses() []string
- type Note
- func (n *Note) GetCreatedAt() time.Time
- func (n *Note) GetID() int64
- func (n *Note) GetTableName() string
- func (n *Note) GetUpdatedAt() time.Time
- func (n *Note) HasLeafletAssociation() bool
- func (n *Note) IsArchived() bool
- func (n *Note) IsPublished() bool
- func (n *Note) MarshalTags() (string, error)
- func (n *Note) SetCreatedAt(time time.Time)
- func (n *Note) SetID(id int64)
- func (n *Note) SetUpdatedAt(time time.Time)
- func (n *Note) UnmarshalTags(data string) error
- type Progressable
- type Queueable
- type RRule
- type Stateful
- type TVShow
- func (tv *TVShow) GetCompletionTime() *time.Time
- func (tv *TVShow) GetCreatedAt() time.Time
- func (tv *TVShow) GetID() int64
- func (tv *TVShow) GetStatus() string
- func (tv *TVShow) GetTableName() string
- func (tv *TVShow) GetUpdatedAt() time.Time
- func (tv *TVShow) IsCompleted() bool
- func (tv *TVShow) IsQueued() bool
- func (tv *TVShow) IsWatched() bool
- func (tv *TVShow) IsWatching() bool
- func (tv *TVShow) SetCreatedAt(time time.Time)
- func (tv *TVShow) SetID(id int64)
- func (tv *TVShow) SetUpdatedAt(time time.Time)
- func (tv *TVShow) ValidStatuses() []string
- type Task
- func (t *Task) Blocks(other *Task) bool
- func (t *Task) GetCreatedAt() time.Time
- func (t *Task) GetID() int64
- func (t *Task) GetPriorityWeight() int
- func (t *Task) GetStatus() string
- func (t *Task) GetTableName() string
- func (t *Task) GetUpdatedAt() time.Time
- func (t *Task) HasDependencies() bool
- func (t *Task) HasDueDate() bool
- func (t *Task) HasPriority() bool
- func (t *Task) IsAbandoned() bool
- func (t *Task) IsBlocked() bool
- func (t *Task) IsCompleted() bool
- func (t *Task) IsDeleted() bool
- func (t *Task) IsDone() bool
- func (t *Task) IsInProgress() bool
- func (t *Task) IsOverdue(now time.Time) bool
- func (t *Task) IsPending() bool
- func (t *Task) IsRecurExpired(now time.Time) bool
- func (t *Task) IsRecurring() bool
- func (t *Task) IsStarted() bool
- func (t *Task) IsTodo() bool
- func (t *Task) IsValidPriority() bool
- func (t *Task) IsValidStatus() bool
- func (t *Task) MarshalAnnotations() (string, error)
- func (t *Task) MarshalTags() (string, error)
- func (t *Task) SetCreatedAt(time time.Time)
- func (t *Task) SetID(id int64)
- func (t *Task) SetUpdatedAt(time time.Time)
- func (t *Task) UnmarshalAnnotations(data string) error
- func (t *Task) UnmarshalTags(data string) error
- func (t *Task) Urgency(now time.Time) float64
- func (t *Task) ValidStatuses() []string
- type TaskPriority
- type TaskStatus
- type TaskWeight
- type TimeEntry
- func (te *TimeEntry) GetCreatedAt() time.Time
- func (te *TimeEntry) GetDuration() time.Duration
- func (te *TimeEntry) GetID() int64
- func (te *TimeEntry) GetTableName() string
- func (te *TimeEntry) GetUpdatedAt() time.Time
- func (te *TimeEntry) IsActive() bool
- func (te *TimeEntry) SetCreatedAt(time time.Time)
- func (te *TimeEntry) SetID(id int64)
- func (te *TimeEntry) SetUpdatedAt(time time.Time)
- func (te *TimeEntry) Stop()
Constants ¶
const ( StatusTodo = "todo" StatusInProgress = "in-progress" StatusBlocked = "blocked" StatusDone = "done" StatusAbandoned = "abandoned" StatusPending = "pending" StatusCompleted = "completed" StatusDeleted = "deleted" )
TODO: Use TaskStatus
const ( PriorityHigh = "High" PriorityMedium = "Medium" PriorityLow = "Low" )
TODO: Use TaskPriority
const ( PriorityNumericMin = 1 PriorityNumericMax = 5 )
TODO: Use TaskWeight
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
ID int64 `json:"id"`
Title string `json:"title"`
Artist string `json:"artist"`
Genre string `json:"genre,omitempty"`
ReleaseYear int `json:"release_year,omitempty"`
Tracks []string `json:"tracks,omitempty"`
DurationSeconds int `json:"duration_seconds,omitempty"`
AlbumArtPath string `json:"album_art_path,omitempty"`
Rating int `json:"rating,omitempty"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
}
Album represents a music album
func (*Album) GetCreatedAt ¶
func (*Album) GetTableName ¶
func (*Album) GetUpdatedAt ¶
func (*Album) IsValidRating ¶
IsValidRating returns true if the rating is between 1 and 5
func (*Album) MarshalTracks ¶
MarshalTracks converts tracks slice to JSON string for database storage
func (*Album) SetCreatedAt ¶
func (*Album) SetUpdatedAt ¶
func (*Album) UnmarshalTracks ¶
UnmarshalTracks converts JSON string from database to tracks slice
type Article ¶
type Article struct {
ID int64 `json:"id"`
URL string `json:"url"`
Title string `json:"title"`
Author string `json:"author,omitempty"`
Date string `json:"date,omitempty"`
MarkdownPath string `json:"markdown_path"`
HTMLPath string `json:"html_path"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
}
Article represents a parsed article from a web URL
func (*Article) GetCreatedAt ¶
func (*Article) GetTableName ¶
func (*Article) GetUpdatedAt ¶
func (*Article) IsValidURL ¶
IsValidURL returns true if the article has parseable URL
func (*Article) SetCreatedAt ¶
func (*Article) SetUpdatedAt ¶
type Book ¶
type Book struct {
ID int64 `json:"id"`
Title string `json:"title"`
Author string `json:"author,omitempty"`
Status string `json:"status"` // queued, reading, finished, removed
Progress int `json:"progress"` // percentage 0-100
Pages int `json:"pages,omitempty"`
Rating float64 `json:"rating,omitempty"`
Notes string `json:"notes,omitempty"`
Added time.Time `json:"added"`
Started *time.Time `json:"started,omitempty"`
Finished *time.Time `json:"finished,omitempty"`
}
Book represents a book in the reading list
func (*Book) GetCompletionTime ¶
GetCompletionTime returns when the book was finished
func (*Book) GetCreatedAt ¶
func (*Book) GetProgress ¶
GetProgress returns the reading progress percentage (0-100)
func (*Book) GetTableName ¶
func (*Book) GetUpdatedAt ¶
func (*Book) IsCompleted ¶
IsCompleted returns true if the book has been finished
func (*Book) IsFinished ¶
IsFinished returns true if the book has been finished
func (*Book) ProgressPercent ¶
ProgressPercent returns the reading progress as a percentage
func (*Book) SetCreatedAt ¶
func (*Book) SetProgress ¶
SetProgress sets the reading progress percentage (0-100)
func (*Book) SetUpdatedAt ¶
func (*Book) ValidStatuses ¶
ValidStatuses returns all valid status values for a book
type Completable ¶
Completable represents media that can be marked as completed/finished/watched. It tracks completion timestamps for media consumption.
Implemented by: Book (finished), Movie (watched), TVShow (watched)
type Model ¶
type Model interface {
GetID() int64 // GetID returns the primary key identifier
SetID(id int64) // SetID sets the primary key identifier
GetTableName() string // GetTableName returns the database table name for this model
GetCreatedAt() time.Time // GetCreatedAt returns when the model was created
SetCreatedAt(t time.Time) // SetCreatedAt sets when the model was created
GetUpdatedAt() time.Time // GetUpdatedAt returns when the model was last updated
SetUpdatedAt(t time.Time) // SetUpdatedAt sets when the model was last updated
}
Model defines the common interface that all domain models must implement
type Movie ¶
type Movie struct {
ID int64 `json:"id"`
Title string `json:"title"`
Year int `json:"year,omitempty"`
Status string `json:"status"` // queued, watched, removed
Rating float64 `json:"rating,omitempty"`
Notes string `json:"notes,omitempty"`
Added time.Time `json:"added"`
Watched *time.Time `json:"watched,omitempty"`
}
Movie represents a movie in the watch queue
func (*Movie) GetCompletionTime ¶
GetCompletionTime returns when the movie was watched
func (*Movie) GetCreatedAt ¶
func (*Movie) GetTableName ¶
func (*Movie) GetUpdatedAt ¶
func (*Movie) IsCompleted ¶
IsCompleted returns true if the movie has been watched
func (*Movie) SetCreatedAt ¶
func (*Movie) SetUpdatedAt ¶
func (*Movie) ValidStatuses ¶
ValidStatuses returns all valid status values for a movie
type Note ¶
type Note struct {
ID int64 `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
Tags []string `json:"tags,omitempty"`
Archived bool `json:"archived"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
FilePath string `json:"file_path,omitempty"`
LeafletRKey *string `json:"leaflet_rkey,omitempty"` // Leaflet record key
LeafletCID *string `json:"leaflet_cid,omitempty"` // Leaflet content identifier
PublishedAt *time.Time `json:"published_at,omitempty"` // Publication timestamp
IsDraft bool `json:"is_draft"` // Draft vs published status
}
Note represents a markdown note
func (*Note) GetCreatedAt ¶
func (*Note) GetTableName ¶
func (*Note) GetUpdatedAt ¶
func (*Note) HasLeafletAssociation ¶
HasLeafletAssociation returns true if the note is associated with a leaflet document
func (*Note) IsArchived ¶
IsArchived returns true if the note is archived
func (*Note) IsPublished ¶
IsPublished returns true if the note is published on leaflet (not a draft)
func (*Note) MarshalTags ¶
MarshalTags converts tags slice to JSON string for database storage
func (*Note) SetCreatedAt ¶
func (*Note) SetUpdatedAt ¶
func (*Note) UnmarshalTags ¶
UnmarshalTags converts JSON string from database to tags slice
type Progressable ¶
type Progressable interface {
Completable
GetProgress() int
SetProgress(progress int) error
}
Progressable represents media with measurable progress tracking
Implemented by: Book (percentage-based reading progress)
type RRule ¶
type RRule string
RRule represents a recurrence rule (RFC 5545). Example: "FREQ=DAILY;INTERVAL=1" or "FREQ=WEEKLY;BYDAY=MO,WE,FR".
type TVShow ¶
type TVShow struct {
ID int64 `json:"id"`
Title string `json:"title"`
Season int `json:"season,omitempty"`
Episode int `json:"episode,omitempty"`
Status string `json:"status"` // queued, watching, watched, removed
Rating float64 `json:"rating,omitempty"`
Notes string `json:"notes,omitempty"`
Added time.Time `json:"added"`
LastWatched *time.Time `json:"last_watched,omitempty"`
}
TVShow represents a TV show in the watch queue
func (*TVShow) GetCompletionTime ¶
GetCompletionTime returns when the TV show was last watched
func (*TVShow) GetCreatedAt ¶
func (*TVShow) GetTableName ¶
func (*TVShow) GetUpdatedAt ¶
func (*TVShow) IsCompleted ¶
IsCompleted returns true if the TV show has been watched
func (*TVShow) IsWatching ¶
IsWatching returns true if the TV show is currently being watched
func (*TVShow) SetCreatedAt ¶
func (*TVShow) SetUpdatedAt ¶
func (*TVShow) ValidStatuses ¶
ValidStatuses returns all valid status values for a TV show
type Task ¶
type Task struct {
ID int64 `json:"id"`
UUID string `json:"uuid"`
Description string `json:"description"`
Status string `json:"status"` // pending, completed, deleted
Priority string `json:"priority,omitempty"` // A-Z or empty
Project string `json:"project,omitempty"`
Context string `json:"context,omitempty"`
Tags []string `json:"tags,omitempty"`
Due *time.Time `json:"due,omitempty"`
Entry time.Time `json:"entry"`
Modified time.Time `json:"modified"`
End *time.Time `json:"end,omitempty"` // Completion time
Start *time.Time `json:"start,omitempty"` // When the task was started
Annotations []string `json:"annotations,omitempty"`
Recur RRule `json:"recur,omitempty"`
Until *time.Time `json:"until,omitempty"` // End date for recurrence
ParentUUID *string `json:"parent_uuid,omitempty"` // ID of parent/template task
DependsOn []string `json:"depends_on,omitempty"` // IDs of tasks this task depends on
}
Task represents a task item with TaskWarrior-inspired fields
func (*Task) GetCreatedAt ¶
func (*Task) GetPriorityWeight ¶
GetPriorityWeight returns a numeric weight for sorting priorities. A higher number = higher priority
func (*Task) GetTableName ¶
func (*Task) GetUpdatedAt ¶
func (*Task) HasDependencies ¶
HasDependencies returns true if the task depends on other tasks.
func (*Task) HasDueDate ¶
HasDueDate returns true if the task has a due date set.
func (*Task) HasPriority ¶
HasPriority returns true if the task has a priority set
func (*Task) IsAbandoned ¶
func (*Task) IsCompleted ¶
IsCompleted returns true if the task is marked as completed
func (*Task) IsInProgress ¶
func (*Task) IsRecurExpired ¶
IsRecurExpired checks if the recurrence has an end (until) date and is past it.
func (*Task) IsRecurring ¶
IsRecurring returns true if the task has recurrence defined.
func (*Task) IsValidPriority ¶
IsValidPriority returns true if the priority is valid (text-based or numeric string)
func (*Task) IsValidStatus ¶
IsValidStatus returns true if the status is one of the defined valid statuses
func (*Task) MarshalAnnotations ¶
MarshalAnnotations converts annotations slice to JSON string for database storage
func (*Task) MarshalTags ¶
MarshalTags converts tags slice to JSON string for database storage
func (*Task) SetCreatedAt ¶
func (*Task) SetUpdatedAt ¶
func (*Task) UnmarshalAnnotations ¶
UnmarshalAnnotations converts JSON string from database to annotations slice
func (*Task) UnmarshalTags ¶
UnmarshalTags converts JSON string from database to tags slice
func (*Task) Urgency ¶
Urgency computes a score based on priority, due date, and tags. This can be expanded later with weights.
func (*Task) ValidStatuses ¶
ValidStatuses returns all valid status values for a task
type TaskPriority ¶
type TaskPriority string
type TaskStatus ¶
type TaskStatus string
type TaskWeight ¶
type TaskWeight int
type TimeEntry ¶
type TimeEntry struct {
ID int64 `json:"id"`
TaskID int64 `json:"task_id"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
DurationSeconds int64 `json:"duration_seconds,omitempty"`
Description string `json:"description,omitempty"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
}
TimeEntry represents a time tracking entry for a task
func (*TimeEntry) GetCreatedAt ¶
func (*TimeEntry) GetDuration ¶
GetDuration returns the duration of the time entry
func (*TimeEntry) GetTableName ¶
func (*TimeEntry) GetUpdatedAt ¶
func (*TimeEntry) IsActive ¶
IsActive returns true if the time entry is currently active (not stopped)