24 lines
714 B
Go
24 lines
714 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
)
|
|
|
|
// Storage defines the interface for file storage operations
|
|
type Storage interface {
|
|
// Save stores a file and returns the storage path
|
|
Save(ctx context.Context, linkID string, filename string, reader io.Reader) (path string, err error)
|
|
|
|
// Get retrieves a file from storage
|
|
Get(ctx context.Context, path string) (io.ReadCloser, error)
|
|
|
|
// Delete removes a file from storage
|
|
Delete(ctx context.Context, path string) error
|
|
|
|
// Exists checks if a file exists in storage
|
|
Exists(ctx context.Context, path string) (bool, error)
|
|
|
|
// DeleteDirectory removes an entire link directory and all its contents
|
|
DeleteDirectory(ctx context.Context, linkID string) error
|
|
}
|