Browse Source

Add storage provider open method

feature/add-image-processing
Roman Zipp 3 years ago
parent
commit
1c861107ad
  1. 4
      storage/storage.go

4
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()

Loading…
Cancel
Save