storage

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	// Upload un fichier vers le storage
	Upload(ctx context.Context, path string, data io.Reader) error

	// Download un fichier depuis le storage
	Download(ctx context.Context, path string) (io.Reader, error)

	// Exists vérifie si un fichier existe
	Exists(ctx context.Context, path string) (bool, error)

	// Delete supprime un fichier
	Delete(ctx context.Context, path string) error

	// List liste les fichiers avec un préfixe donné
	List(ctx context.Context, prefix string) ([]string, error)

	// GetURL retourne l'URL d'accès à un fichier (pour les résultats)
	GetURL(ctx context.Context, path string) (string, error)
}

Storage définit l'interface pour le stockage de fichiers

type StorageConfig

type StorageConfig struct {
	Type         string // "filesystem" ou "garage"
	BasePath     string // Pour filesystem
	Endpoint     string // Pour S3/Garage
	UsePathStyle bool
	AccessKey    string
	SecretKey    string
	Bucket       string
	Region       string
}

StorageConfig contient la configuration du storage

Jump to

Keyboard shortcuts

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