draincloud-core/internal/files_engine/engine.go
2024-11-29 00:23:56 -05:00

41 lines
663 B
Go

package filesengine
import (
"context"
"git.optclblast.xyz/draincloud/draincloud-core/internal/storage"
)
type FilesEngine struct {
blobStorage storage.BlobStorage
metaStorage storage.MetaStorage
}
func NewFilesEngine(
blobStorage storage.BlobStorage,
metaStorage storage.MetaStorage,
) *FilesEngine {
return &FilesEngine{
blobStorage: blobStorage,
metaStorage: metaStorage,
}
}
type File struct {
Name string
UserID int64
Ext FileExtension
Type string
Size int64
Data []byte
}
func (e *FilesEngine) SaveFile(
ctx context.Context,
file File,
) (int64, error) {
e.metaStorage.SaveMetadata(ctx, file.Type, )
return -1, nil
}