summaryrefslogtreecommitdiff
path: root/internal/client/output/output_client_interface.go
blob: c74851d4808622c70ee6d8a6dc499187e18bacc0 (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
package output

import (
	"io"
	"time"

	"github.com/SayaAndy/saya-today-thumbnail-generator/config"
	"github.com/SayaAndy/saya-today-thumbnail-generator/internal/client/input"
)

type OutputClient interface {
	GetWriter(path string, inputMetadata *input.MetadataStruct) (io.WriteCloser, error)
	ReadMetadata(path string) (*MetadataStruct, error)
	IsMissing(path string) bool
}

type MetadataStruct struct {
	Name         string
	StorageType  string
	Hash         string
	HashOriginal string
	ContentType  string
	FirstCreated time.Time
	LastModified time.Time
	Size         int64
	Misc         map[string]string
}

var NewOutputClientMap = map[string]func(cfg *config.OutputConfig) (OutputClient, error){
	"b2":         NewB2OutputClient,
	"local-unix": NewLocalUnixOutputClient,
}