summaryrefslogtreecommitdiff
path: root/internal/storage/storage_interface.go
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'internal/storage/storage_interface.go')
-rw-r--r--internal/storage/storage_interface.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/internal/storage/storage_interface.go b/internal/storage/storage_interface.go
index 91eeedb..92a37e2 100644
--- a/internal/storage/storage_interface.go
+++ b/internal/storage/storage_interface.go
@@ -1,19 +1,17 @@
package storage
import (
- "io"
-
"github.com/SayaAndy/saya-today-article-metadata-add/config"
"github.com/SayaAndy/saya-today-article-metadata-add/internal/frontmatter"
)
type StorageClient interface {
- Scan() (paths []string, err error)
- GetReader(path string) (reader io.ReadCloser, sz int64, err error)
- WriteMetadata(path string, metadata *frontmatter.Metadata) error
- FileHasChanged(path string) bool
+ Put(key string, content []byte, metadata *frontmatter.Metadata) error
+ GetMetadata(key string) (metadata map[string]string, err error)
+ BuildIndex() error
}
-var NewStorageClientMap = map[string]func(cfg *config.StorageConfig) (StorageClient, error){
+var NewStorageClientMap = map[string]func(*config.StorageConfig) (StorageClient, error){
"b2": NewB2StorageClient,
+ "s3": NewS3StorageClient,
}