Files
RenewCMS/internal/infrastructure/storage/storage.go
T

23 lines
393 B
Go

package storage
import (
domain "RenewCMS/internal/domain/image"
"fmt"
)
const DriverLocal = "local"
type Config struct {
Driver string
Location string
}
func Open(config Config) (domain.Storage, error) {
switch config.Driver {
case DriverLocal:
return NewLocalStorage(config.Location), nil
default:
return nil, fmt.Errorf("unsupported storage driver %q", config.Driver)
}
}