aboutsummaryrefslogtreecommitdiff
path: root/internal/gallery/query.go
diff options
context:
space:
mode:
authorSaiyed Shizain <saiyedshizain@gmail.com>2026-07-22 17:32:55 +0530
committerGitHub <noreply@github.com>2026-07-22 17:32:55 +0530
commit9b541ca2d0a639eebd9610fcd6385e841da68e0a (patch)
treed331e8d858f62cf82d0cb6c3ca96400d4e28edca /internal/gallery/query.go
parent46d2bf8bb5a0d18bdbe613a9346a5757b39e0a35 (diff)
parentddd8a37a0eb5623960e4528802263c7cec23af87 (diff)
downloadgalleryd-9b541ca2d0a639eebd9610fcd6385e841da68e0a.tar.xz
galleryd-9b541ca2d0a639eebd9610fcd6385e841da68e0a.zip
Merge pull request #13 from RanXom/feat/api
Feat/api: add sorting support to gallery queries
Diffstat (limited to 'internal/gallery/query.go')
-rw-r--r--internal/gallery/query.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/gallery/query.go b/internal/gallery/query.go
new file mode 100644
index 0000000..e2003d5
--- /dev/null
+++ b/internal/gallery/query.go
@@ -0,0 +1,27 @@
+package gallery
+
+type SortField string
+
+const (
+ SortByDateTaken SortField = "dateTaken"
+ SortByPath SortField = "path"
+)
+
+// SortOrder identifies the sort direction
+type SortOrder string
+
+const (
+ SortAsc SortOrder = "asc"
+ SortDesc SortOrder = "desc"
+)
+
+// Query describes how photos should be selected.
+//
+// The zero value returns the entire gallery.
+type Query struct {
+ Limit int
+ Offset int
+
+ Sort SortField
+ Order SortOrder
+}