summaryrefslogtreecommitdiffstats
path: root/pkg/entries/model.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/entries/model.go')
-rw-r--r--pkg/entries/model.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/entries/model.go b/pkg/entries/model.go
new file mode 100644
index 0000000..9ddcd20
--- /dev/null
+++ b/pkg/entries/model.go
@@ -0,0 +1,30 @@
+package entries
+
+import "git.leonardobishop.net/stash/pkg/database/sqlc"
+
+type EntryRow struct {
+ Title string `json:"title"`
+ Url string `json:"url"`
+ Description string `json:"description"`
+ Timestamp string `json:"timestamp"`
+ KindName string `json:"kind_name"`
+ KindEmoji string `json:"kind_emoji"`
+}
+
+func (dst *EntryRow) ScanGetEntriesByKindRow(src sqlc.GetEntriesByKindRow) {
+ dst.Title = src.Title
+ dst.Url = src.Url
+ dst.Description = src.Description
+ dst.Timestamp = src.Timestamp
+ dst.KindName = src.KindName
+ dst.KindEmoji = src.KindEmoji
+}
+
+func (dst *EntryRow) ScanGetEntriesRow(src sqlc.GetEntriesRow) {
+ dst.Title = src.Title
+ dst.Url = src.Url
+ dst.Description = src.Description
+ dst.Timestamp = src.Timestamp
+ dst.KindName = src.KindName
+ dst.KindEmoji = src.KindEmoji
+}