Skip to content

Commit

Permalink
fix: s3 interface
Browse files Browse the repository at this point in the history
  • Loading branch information
withchao committed Jul 15, 2024
1 parent 1ade4cf commit a53203c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 25 deletions.
4 changes: 0 additions & 4 deletions s3/cos/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,3 @@ func sha1val(msg string) string {
sha1Hash.Write([]byte(msg))
return hex.EncodeToString(sha1Hash.Sum(nil))
}

func (m *Cos) GetImageThumbnailKey(ctx context.Context, name string) (string, error) {
panic("implement me.")
}
15 changes: 0 additions & 15 deletions s3/minio/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"net/http"
"net/url"
"path"
"path/filepath"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -498,17 +497,3 @@ func (m *Minio) FormData(ctx context.Context, name string, size int64, contentTy
SuccessCodes: []int{successCode},
}, nil
}

func (m *Minio) GetImageThumbnailKey(ctx context.Context, name string) (string, error) {
info, img, err := m.getObjectImageInfo(ctx, name)
if err != nil {
return "", errs.Wrap(err)
}
if !info.IsImg {
return "", errs.New("object not image").Wrap()
}
thumbnailWidth, thumbnailHeight := getThumbnailSize(img)

cacheKey := filepath.Join(imageThumbnailPath, info.Etag, fmt.Sprintf("image_w%d_h%d.%s", thumbnailWidth, thumbnailHeight, info.Format))
return cacheKey, nil
}
4 changes: 0 additions & 4 deletions s3/oss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,3 @@ func (o *OSS) FormData(ctx context.Context, name string, size int64, contentType
}
return fd, nil
}

func (m *OSS) GetImageThumbnailKey(ctx context.Context, name string) (string, error) {
panic("implement me.")
}
2 changes: 0 additions & 2 deletions s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,4 @@ type Interface interface {
AccessURL(ctx context.Context, name string, expire time.Duration, opt *AccessURLOption) (string, error)

FormData(ctx context.Context, name string, size int64, contentType string, duration time.Duration) (*FormData, error)

GetImageThumbnailKey(ctx context.Context, name string) (string, error)
}

0 comments on commit a53203c

Please sign in to comment.