From e712b52e77481400242fc00c2098f5d060db77e8 Mon Sep 17 00:00:00 2001 From: Roman Zipp Date: Thu, 20 Jan 2022 17:58:40 +0100 Subject: [PATCH] Add storage provider open method --- storage/storage.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/storage.go b/storage/storage.go index 313ba26..9d0f2d2 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -50,6 +50,10 @@ func (sp FileSystemStorageProvider) GetPath(bucketName string, objectName string return filepath.Join(sp.wd, StorageFolderName, sp.basePath, bucketName, objectName) } +func (sp FileSystemStorageProvider) OpenFile(bucketName string, objectName string) (*os.File, error) { + return os.Open(sp.GetPath(bucketName, objectName)) +} + func GetFileSystemStorageProvider(basePath string, wd string) FileSystemStorageProvider { if wd == "" { wd, _ = os.Getwd()