Documentation
¶
Index ¶
- func NewStorage(config *storage.StorageConfig) (storage.Storage, error)
- type StorageService
- func (s *StorageService) CleanupJob(ctx context.Context, jobID uuid.UUID) error
- func (s *StorageService) DownloadJobSource(ctx context.Context, jobID uuid.UUID, filename string) (io.Reader, error)
- func (s *StorageService) DownloadResult(ctx context.Context, courseID uuid.UUID, filename string) (io.Reader, error)
- func (s *StorageService) GetJobLog(ctx context.Context, jobID uuid.UUID) (string, error)
- func (s *StorageService) GetJobSourceTree(ctx context.Context, jobID uuid.UUID) (map[string][]string, error)
- func (s *StorageService) GetResultURL(ctx context.Context, courseID uuid.UUID, filename string) (string, error)
- func (s *StorageService) ListJobSources(ctx context.Context, jobID uuid.UUID) ([]string, error)
- func (s *StorageService) ListResults(ctx context.Context, courseID uuid.UUID) ([]string, error)
- func (s *StorageService) SaveJobLog(ctx context.Context, jobID uuid.UUID, logContent string) error
- func (s *StorageService) UploadJobSource(ctx context.Context, jobID uuid.UUID, filename string, content io.Reader) error
- func (s *StorageService) UploadJobSourceWithPath(ctx context.Context, jobID uuid.UUID, filePath string, content io.Reader) error
- func (s *StorageService) UploadJobSources(ctx context.Context, jobID uuid.UUID, files []*multipart.FileHeader) error
- func (s *StorageService) UploadResult(ctx context.Context, courseID uuid.UUID, filename string, content io.Reader) error
- func (s *StorageService) ValidateFile(filePath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorage ¶
func NewStorage(config *storage.StorageConfig) (storage.Storage, error)
NewStorage crée une nouvelle instance de storage basée sur la configuration
Types ¶
type StorageService ¶
type StorageService struct {
// contains filtered or unexported fields
}
func NewStorageService ¶
func NewStorageService(storage storage.Storage) *StorageService
func (*StorageService) CleanupJob ¶
CleanupJob supprime tous les fichiers liés à un job
func (*StorageService) DownloadJobSource ¶
func (s *StorageService) DownloadJobSource(ctx context.Context, jobID uuid.UUID, filename string) (io.Reader, error)
DownloadJobSource télécharge un fichier source
func (*StorageService) DownloadResult ¶
func (s *StorageService) DownloadResult(ctx context.Context, courseID uuid.UUID, filename string) (io.Reader, error)
DownloadResult télécharge un résultat généré
func (*StorageService) GetJobSourceTree ¶ added in v0.0.4
func (s *StorageService) GetJobSourceTree(ctx context.Context, jobID uuid.UUID) (map[string][]string, error)
GetJobSourceTree retourne l'arbre des fichiers sources organisé par dossiers
func (*StorageService) GetResultURL ¶
func (s *StorageService) GetResultURL(ctx context.Context, courseID uuid.UUID, filename string) (string, error)
GetResultURL retourne l'URL d'accès à un résultat
func (*StorageService) ListJobSources ¶
ListJobSources liste les fichiers source d'un job avec leurs chemins complets
func (*StorageService) ListResults ¶
ListResults liste les fichiers de résultat d'un cours
func (*StorageService) SaveJobLog ¶
SaveJobLog sauvegarde les logs d'un job
func (*StorageService) UploadJobSource ¶
func (s *StorageService) UploadJobSource(ctx context.Context, jobID uuid.UUID, filename string, content io.Reader) error
UploadJobSource upload un fichier source unique
func (*StorageService) UploadJobSourceWithPath ¶ added in v0.0.4
func (s *StorageService) UploadJobSourceWithPath(ctx context.Context, jobID uuid.UUID, filePath string, content io.Reader) error
UploadJobSourceWithPath upload un fichier source avec un chemin explicite
func (*StorageService) UploadJobSources ¶
func (s *StorageService) UploadJobSources(ctx context.Context, jobID uuid.UUID, files []*multipart.FileHeader) error
UploadJobSources upload les fichiers source pour un job
func (*StorageService) UploadResult ¶
func (s *StorageService) UploadResult(ctx context.Context, courseID uuid.UUID, filename string, content io.Reader) error
UploadResult upload le résultat généré pour un cours
func (*StorageService) ValidateFile ¶
func (s *StorageService) ValidateFile(filePath string) error
ValidateFile valide un fichier uploadé