Florian Forster fa9f581d56
chore(v2): move to new org (#3499)
* chore: move to new org

* logging

* fix: org rename caos -> zitadel

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
2022-04-26 23:01:45 +00:00

31 lines
725 B
Go

package config
import (
"database/sql"
"github.com/zitadel/zitadel/internal/errors"
"github.com/zitadel/zitadel/internal/static"
"github.com/zitadel/zitadel/internal/static/database"
"github.com/zitadel/zitadel/internal/static/s3"
)
type AssetStorageConfig struct {
Type string
Config map[string]interface{} `mapstructure:",remain"`
}
func (a *AssetStorageConfig) NewStorage(client *sql.DB) (static.Storage, error) {
t, ok := storage[a.Type]
if !ok {
return nil, errors.ThrowInternalf(nil, "STATIC-dsbjh", "config type %s not supported", a.Type)
}
return t(client, a.Config)
}
var storage = map[string]static.CreateStorage{
"db": database.NewStorage,
"": database.NewStorage,
"s3": s3.NewStorage,
}