Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage implements Storage using the local filesystem.
func NewLocalStorage ¶
func NewLocalStorage(basePath string) *LocalStorage
NewLocalStorage creates a new local storage instance.
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(storagePath string) error
Delete removes a file by storage path.
func (*LocalStorage) Get ¶
func (s *LocalStorage) Get(storagePath string) (io.ReadCloser, error)
Get retrieves a file by storage path.
func (*LocalStorage) GetFullPath ¶
func (s *LocalStorage) GetFullPath(storagePath string) string
GetFullPath returns the full filesystem path.
type Storage ¶
type Storage interface {
// Save stores file data and returns the storage path and hash.
Save(filename string, reader io.Reader) (storagePath string, hash string, size int64, err error)
// Get retrieves a file by its storage path.
Get(storagePath string) (io.ReadCloser, error)
// Delete removes a file by its storage path.
Delete(storagePath string) error
// GetFullPath returns the full filesystem path for a storage path.
GetFullPath(storagePath string) string
}
Storage defines the interface for file storage operations.
Click to show internal directories.
Click to hide internal directories.