aboutsummaryrefslogtreecommitdiff
path: root/pkg/components/media
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-02-26 19:54:48 +0100
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-18 16:30:36 +0200
commitc8e1328164e9ffbd681c3c0e449f1e6b9856b896 (patch)
treefaee639a4c55c5dc3bfc59a5400026822c40221d /pkg/components/media
downloadlens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.tar.gz
lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.tar.bz2
lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.zip
feat: Inicial commit
It contains rough template for the server and runners. It contains rough template for the server and runners.
Diffstat (limited to 'pkg/components/media')
-rw-r--r--pkg/components/media/model.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkg/components/media/model.go b/pkg/components/media/model.go
new file mode 100644
index 0000000..f5c9ff6
--- /dev/null
+++ b/pkg/components/media/model.go
@@ -0,0 +1,57 @@
+package media
+
+import (
+ "context"
+ "time"
+)
+
+type (
+ Media struct {
+ ID uint
+ Name string
+ Path string
+ PathHash string
+ MIMEType string
+ }
+
+ MediaEXIF struct {
+ Description *string
+ Camera *string
+ Maker *string
+ Lens *string
+ DateShot *time.Time
+ Exposure *float64
+ Aperture *float64
+ Iso *int64
+ FocalLength *float64
+ Flash *int64
+ Orientation *int64
+ ExposureProgram *int64
+ GPSLatitude *float64
+ GPSLongitude *float64
+ }
+
+ Pagination struct {
+ Page int
+ Size int
+ }
+
+ CreateMedia struct {
+ Name string
+ Path string
+ PathHash string
+ MIMEType string
+ }
+
+ Repository interface {
+ Create(context.Context, *CreateMedia) error
+ Exists(context.Context, string) (bool, error)
+ List(context.Context, *Pagination) ([]*Media, error)
+ Get(context.Context, string) (*Media, error)
+ GetPath(context.Context, string) (string, error)
+
+ GetEmptyEXIF(context.Context, *Pagination) ([]*Media, error)
+ GetEXIF(context.Context, uint) (*MediaEXIF, error)
+ CreateEXIF(context.Context, uint, *MediaEXIF) error
+ }
+)