store.go 698 B

12345678910111213141516171819202122232425262728
  1. package store
  2. import (
  3. "context"
  4. "github.com/minio/minio-go"
  5. "io"
  6. "net/http"
  7. )
  8. type Backend interface {
  9. Store(ctx context.Context, filename string, data io.Reader, size int64) (string, error)
  10. Get(ctx context.Context, fileName string) ([]byte, string, error)
  11. Delete(ctx context.Context, fileName string) error
  12. ComposeObject(ctx context.Context,pathS []string,filePath string) error
  13. RemoveObject(ctx context.Context,filePath string) error
  14. Stat(filename string) (minio.ObjectInfo, error)
  15. }
  16. type FileInfo interface {
  17. FullName() string
  18. Name() string
  19. Size() int64
  20. Hash() string
  21. }
  22. type Uploader interface {
  23. Upload(ctx context.Context, r *http.Request, key string) ([]FileInfo, error)
  24. }