storage

package
v0.0.0-...-8491d02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStorage

type FileStorage interface {
	// SaveFile saves a file to storage
	SaveFile(file *multipart.FileHeader, taskID, userID uuid.UUID) (string, error)

	// GetFile retrieves a file from storage
	GetFile(storagePath string) (io.ReadCloser, error)

	// DeleteFile deletes a file from storage
	DeleteFile(storagePath string) error
}

FileStorage defines the interface for file storage operations

func NewLocalFileStorage

func NewLocalFileStorage(basePath string) FileStorage

NewLocalFileStorage creates a new LocalFileStorage

type LocalFileStorage

type LocalFileStorage struct {
	// contains filtered or unexported fields
}

LocalFileStorage implements FileStorage using the local file system

func (*LocalFileStorage) DeleteFile

func (s *LocalFileStorage) DeleteFile(storagePath string) error

DeleteFile deletes a file from storage

func (*LocalFileStorage) GetFile

func (s *LocalFileStorage) GetFile(storagePath string) (io.ReadCloser, error)

GetFile retrieves a file from storage

func (*LocalFileStorage) SaveFile

func (s *LocalFileStorage) SaveFile(file *multipart.FileHeader, taskID, userID uuid.UUID) (string, error)

SaveFile saves a file to storage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL