summaryrefslogtreecommitdiff
path: root/internal/client/input/input_client_interface.go
blob: a2cf84b71f07301e6dc04856805d4462dcf2b215 (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
package input

import (
	"io"
	"time"

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

type InputClient interface {
	Scan() ([]string, error)
	ReadMetadata(string) (*MetadataStruct, error)
	GetReader(string) (io.ReadCloser, error)
	ID(path string) string
}

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

var NewInputClientMap = map[string]func(cfg *config.InputConfig) (InputClient, error){
	"b2":         NewB2InputClient,
	"local-unix": NewLocalUnixInputClient,
}