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 Width *float64
19 Height *float64
20 Description *string
21 Camera *string
22 Maker *string
23 Lens *string
24 DateShot *time.Time
25 Exposure *float64
26 Aperture *float64
27 Iso *int64
28 FocalLength *float64
29 Flash *int64
30 Orientation *int64
31 ExposureProgram *int64
32 GPSLatitude *float64
33 GPSLongitude *float64
34 }
35
36 Pagination struct {
37 Page int
38 Size int
39 }
40
41 CreateMedia struct {
42 Name string
43 Path string
44 PathHash string
45 MIMEType string
46 }
47
48 Repository interface {
49 Create(context.Context, *CreateMedia) error
50 Exists(context.Context, string) (bool, error)
51 List(context.Context, *Pagination) ([]*Media, error)
52 Get(context.Context, string) (*Media, error)
53 GetPath(context.Context, string) (string, error)
54
55 GetEmptyEXIF(context.Context, *Pagination) ([]*Media, error)
56 GetEXIF(context.Context, uint) (*MediaEXIF, error)
57 CreateEXIF(context.Context, uint, *MediaEXIF) error
58 }
59)