summaryrefslogtreecommitdiff
path: root/internal/media/handler.go
diff options
context:
space:
mode:
authorLibravatar kim (grufwub) <grufwub@gmail.com>2021-09-11 20:18:06 +0100
committerLibravatar kim (grufwub) <grufwub@gmail.com>2021-09-11 20:18:06 +0100
commit7f36688643dfa6a08d032ffdb61cbf1c5370d3c4 (patch)
treeb623b44349eee12133a2cada1d2b1d6a19b2f626 /internal/media/handler.go
parentadd git.iim.gay/grufwub/go-store for storage backend, replacing blob.Storage (diff)
downloadgotosocial-7f36688643dfa6a08d032ffdb61cbf1c5370d3c4.tar.xz
rename KVStore uses as storage to differentiate between upcoming store package
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'internal/media/handler.go')
-rw-r--r--internal/media/handler.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/media/handler.go b/internal/media/handler.go
index f2450bbc0..058337ecf 100644
--- a/internal/media/handler.go
+++ b/internal/media/handler.go
@@ -84,19 +84,19 @@ type Handler interface {
}
type mediaHandler struct {
- config *config.Config
- db db.DB
- store *kv.KVStore
- log *logrus.Logger
+ config *config.Config
+ db db.DB
+ storage *kv.KVStore
+ log *logrus.Logger
}
// New returns a new handler with the given config, db, storage, and logger
-func New(config *config.Config, database db.DB, store *kv.KVStore, log *logrus.Logger) Handler {
+func New(config *config.Config, database db.DB, storage *kv.KVStore, log *logrus.Logger) Handler {
return &mediaHandler{
- config: config,
- db: database,
- store: store,
- log: log,
+ config: config,
+ db: database,
+ storage: storage,
+ log: log,
}
}
@@ -257,12 +257,12 @@ func (mh *mediaHandler) ProcessLocalEmoji(ctx context.Context, emojiBytes []byte
emojiStaticPath := fmt.Sprintf("%s/%s/%s/%s/%s.png", mh.config.StorageConfig.BasePath, instanceAccount.ID, Emoji, Static, newEmojiID)
// Store the original emoji
- if err := mh.store.Put(emojiPath, original.image); err != nil {
+ if err := mh.storage.Put(emojiPath, original.image); err != nil {
return nil, fmt.Errorf("storage error: %s", err)
}
// Store the static emoji
- if err := mh.store.Put(emojiStaticPath, static.image); err != nil {
+ if err := mh.storage.Put(emojiStaticPath, static.image); err != nil {
return nil, fmt.Errorf("storage error: %s", err)
}