summaryrefslogtreecommitdiff
path: root/internal/client/input/input_client_interface.go
blob: 4930aa0b9fc362c1da2dd8bbd5025e4317db5ce0 (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
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)
}

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,
}