74 lines
1.3 KiB
Go
74 lines
1.3 KiB
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
"net/url"
|
|
"time"
|
|
|
|
"trankilou.fr/lassistanoque/backend/internal/domain"
|
|
)
|
|
|
|
type DatabaseStorageProvider struct {
|
|
repo domain.FileRepository
|
|
}
|
|
|
|
func NewDatabaseStorageProvider(repo domain.FileRepository) *DatabaseStorageProvider {
|
|
return &DatabaseStorageProvider{repo}
|
|
}
|
|
|
|
func (p *DatabaseStorageProvider) EnsureBucket(
|
|
ctx context.Context,
|
|
bucketName string,
|
|
) error {
|
|
return nil
|
|
}
|
|
|
|
func (p *DatabaseStorageProvider) PutObject(
|
|
ctx context.Context,
|
|
reader io.Reader,
|
|
bucketName string,
|
|
objectName string,
|
|
filePath string,
|
|
contentType string,
|
|
) error {
|
|
return nil
|
|
}
|
|
|
|
func (p *DatabaseStorageProvider) GetObject(
|
|
ctx context.Context,
|
|
bucketName string,
|
|
objectName string,
|
|
filePath string,
|
|
) (io.ReadCloser, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (p *DatabaseStorageProvider) DeleteObject(
|
|
ctx context.Context,
|
|
bucketName string,
|
|
objectName string,
|
|
filePath string,
|
|
) error {
|
|
return nil
|
|
}
|
|
|
|
func (p *DatabaseStorageProvider) ExistsObject(
|
|
ctx context.Context,
|
|
bucketName string,
|
|
objectName string,
|
|
filePath string,
|
|
) (bool, error) {
|
|
return false, nil
|
|
}
|
|
func (p *DatabaseStorageProvider) GetPresignedURL(
|
|
ctx context.Context,
|
|
bucketName string,
|
|
objectName string,
|
|
filePath string,
|
|
Expiry time.Time,
|
|
) (*url.URL, error) {
|
|
parsed, _ := url.Parse("https://localhost")
|
|
return parsed, nil
|
|
}
|