2022-05-24 18:03:31 +09:30
|
|
|
package entity
|
|
|
|
|
2025-05-01 23:39:51 +09:30
|
|
|
import (
|
|
|
|
"html/template"
|
|
|
|
"time"
|
|
|
|
)
|
2022-05-24 18:03:31 +09:30
|
|
|
|
|
|
|
type Bookmark struct {
|
2022-05-28 16:16:08 +09:30
|
|
|
ID uint64 `boltholdKey:"ID"`
|
2022-05-24 18:03:31 +09:30
|
|
|
URL string
|
|
|
|
Info PageInfo
|
|
|
|
Tags []string
|
2022-06-05 11:19:44 +09:30
|
|
|
PreserveTitle bool
|
2022-05-24 18:03:31 +09:30
|
|
|
TimestampCreated time.Time
|
|
|
|
TimestampLastScraped time.Time
|
|
|
|
}
|
|
|
|
|
2025-05-01 23:39:51 +09:30
|
|
|
func (bm Bookmark) Type() string {
|
|
|
|
return "bookmark"
|
|
|
|
}
|
|
|
|
|
2022-05-24 18:03:31 +09:30
|
|
|
type PageInfo struct {
|
|
|
|
Fetched time.Time
|
|
|
|
Title string
|
|
|
|
Size int
|
|
|
|
StatusCode int
|
|
|
|
RawText string
|
|
|
|
}
|
2025-05-01 23:39:51 +09:30
|
|
|
|
|
|
|
func (pi PageInfo) Type() string {
|
|
|
|
return "info"
|
|
|
|
}
|
|
|
|
|
|
|
|
type BookmarkSearchResult struct {
|
|
|
|
Bookmark Bookmark
|
|
|
|
Score float64
|
|
|
|
Highlight template.HTML
|
|
|
|
}
|