Files
vex/tui/models/entry.go
T
2024-05-05 19:54:18 +02:00

36 lines
816 B
Go

package models
import (
"fmt"
"time"
"github.com/google/uuid"
)
type Entry struct {
Id uuid.UUID `json:"id"`
ArticleTitle string `json:"title"`
Content string `json:"content"`
Link string `json:"link"`
Date time.Time `json:"date"`
Authors []string `json:"authors"` // author not always specified
IsRead bool `json:"isRead"`
IsBookmarked bool `json:"IsBookmarked"`
IsIgnored bool `json:"isIgnored"`
IsReadLater bool `json:"isReadLater"`
Feed Feed `json:"feed"`
}
func (e Entry) FilterValue() string {
return e.ArticleTitle
}
func (e Entry) Title() string {
return e.ArticleTitle
}
func (e Entry) Description() string {
return fmt.Sprintf("%s", "my desc") // TODO: real description (tags and author + date ?)
}