Browse Source
Add storage provider open method
feature/add-authorization
Roman Zipp
3 years ago
committed by
Fabian Vowie
No known key found for this signature in database
GPG Key ID: C27317C33B27C410
1 changed files with
4 additions and
0 deletions
-
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() |
|
|
|