1package media
2
3import (
4 "context"
5 "time"
6)
7
8type (
9 Media struct {
10 ID uint
11 Name string
12 Path string
13 PathHash string
14 MIMEType string
15 }
16
17 MediaEXIF struct {
18 Description *string
19 Camera *string
20 Maker *string
21 Lens *string
22 DateShot *time.Time
23 Exposure *float64
24 Aperture *float64
25 Iso *int64
26 FocalLength *float64
27 Flash *int64
28 Orientation *int64
29 ExposureProgram *int64
30 GPSLatitude *float64
31 GPSLongitude *float64
32 }
33
34 Pagination struct {
35 Page int
36 Size int
37 }
38
39 CreateMedia struct {
40 Name string
41 Path string
42 PathHash string
43 MIMEType string
44 }
45
46 Repository interface {
47 Create(context.Context, *CreateMedia) error
48 Exists(context.Context, string) (bool, error)
49 List(context.Context, *Pagination) ([]*Media, error)
50 Get(context.Context, string) (*Media, error)
51 GetPath(context.Context, string) (string, error)
52
53 GetEmptyEXIF(context.Context, *Pagination) ([]*Media, error)
54 GetEXIF(context.Context, uint) (*MediaEXIF, error)
55 CreateEXIF(context.Context, uint, *MediaEXIF) error
56 }
57)