Skip to content

Commit

Permalink
chore(memory): ability to provide storage
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Oct 16, 2024
1 parent 01fa9e4 commit c39198b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions storage/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type StorageMemory struct {
var _ ObjectStorage = &StorageMemory{}
var _ ObjectStorage = (*StorageMemory)(nil)

func NewStorageMemory() (*StorageMemory, error) {
func NewStorageMemory(st map[string]map[string]string) (*StorageMemory, error) {
return &StorageMemory{
storage: map[string]map[string]string{},
storage: st,
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func EnvDriverDetector(logger *slog.Logger) (storage.ObjectStorage, error) {
logger.Info("driver detected", "driver", driver)

if driver == "memory" {
return storage.NewStorageMemory()
return storage.NewStorageMemory(map[string]map[string]string{})
} else if driver == "minio" {
url := GetEnv("MINIO_URL", "")
user := GetEnv("MINIO_ROOT_USER", "")
Expand Down

0 comments on commit c39198b

Please sign in to comment.