summaryrefslogtreecommitdiff
path: root/internal/storage/storage_interface.go
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'internal/storage/storage_interface.go')
-rw-r--r--internal/storage/storage_interface.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/internal/storage/storage_interface.go b/internal/storage/storage_interface.go
index 7134e30..92a37e2 100644
--- a/internal/storage/storage_interface.go
+++ b/internal/storage/storage_interface.go
@@ -1,20 +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
- CompareDraftAndProd(path string) (changed 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(*config.StorageConfig, *config.DraftModeConfig) (StorageClient, error){
+var NewStorageClientMap = map[string]func(*config.StorageConfig) (StorageClient, error){
"b2": NewB2StorageClient,
"s3": NewS3StorageClient,
}