git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/storage/storage.go (about)

     1  package storage
     2  
     3  import (
     4  	"context"
     5  	"io"
     6  )
     7  
     8  type Storage interface {
     9  	BasePath() string
    10  	CopyObject(ctx context.Context, from, to string) error
    11  	DeleteObject(ctx context.Context, key string) error
    12  	GetObject(ctx context.Context, key string) (io.ReadCloser, error)
    13  	GetObjectSize(ctx context.Context, key string) (int64, error)
    14  	// GetPresignedUploadUrl(ctx context.Context, key string, size uint64) (string, error)
    15  	PutObject(ctx context.Context, key, contentType string, size int64, object io.Reader) error
    16  	DeleteObjectsWithPrefix(ctx context.Context, prefix string) (err error)
    17  }