aboutsummaryrefslogtreecommitdiff
path: root/pkg/components/media/model.go
blob: f5c9ff6e725f7fc9bb25db01793b69835742e0ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
	}
)