Documentation
¶
Index ¶
- func Close() error
- func GetPresignedURL(ctx context.Context, objectName string, expires time.Duration) (*url.URL, error)
- func ListObjects(ctx context.Context) ([]string, error)
- func SaveFileMeta(key string, metadata *FileMetadata) error
- func UploadFile(ctx context.Context, objectName string, reader io.Reader, size int64) (minio.UploadInfo, error)
- type DragonflyStorage
- type FileMetadata
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPresignedURL ¶
func GetPresignedURL(ctx context.Context, objectName string, expires time.Duration) (*url.URL, error)
GetPresignedURL generates a temporary, presigned URL for downloading a file.
func ListObjects ¶
ListObjects lists all objects in the bucket for debugging purposes.
func SaveFileMeta ¶
func SaveFileMeta(key string, metadata *FileMetadata) error
Types ¶
type DragonflyStorage ¶
type DragonflyStorage struct {
// contains filtered or unexported fields
}
DragonflyStorage implements the Storage interface using Dragonfly/Redis.
type FileMetadata ¶
type FileMetadata struct { Filename string `json:"filename"` Size int64 `json:"size"` StoragePath string `json:"storagePath"` }
FileMetadata defines the structure for storing file information. This is the canonical definition used across the application.
func GetFileMeta ¶
func GetFileMeta(key string) (*FileMetadata, error)
type Storage ¶
type Storage interface { // SaveFileMeta saves the file metadata with a given key and TTL. SaveFileMeta(key string, metadata *FileMetadata) error // GetFileMeta retrieves file metadata by its key. GetFileMeta(key string) (*FileMetadata, error) }
Storage defines the interface for all data storage operations. This allows for decoupling the business logic from the concrete storage implementation.
Click to show internal directories.
Click to hide internal directories.