aboutsummaryrefslogtreecommitdiff
path: root/pkg/components/media/model.go
blob: 0e17e9231f4f7ded99d4d6fa6e866f34756a5514 (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
58
59
package media

import (
	"context"
	"time"
)

type (
	Media struct {
		ID       uint
		Name     string
		Path     string
		PathHash string
		MIMEType string
	}

	MediaEXIF struct {
		Width           *float64
		Height          *float64
		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
	}
)