diff options
Diffstat (limited to 'experimental/embed/provider/storage.go')
| -rw-r--r-- | experimental/embed/provider/storage.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/experimental/embed/provider/storage.go b/experimental/embed/provider/storage.go new file mode 100644 index 000000000..42c40aefd --- /dev/null +++ b/experimental/embed/provider/storage.go @@ -0,0 +1,29 @@ +package provider + +import ( + "crypto/x509" + + "github.com/authelia/authelia/v4/internal/configuration/schema" + "github.com/authelia/authelia/v4/internal/storage" +) + +// NewStoragePostgreSQL creates a new storage.Provider using the *storage.PostgreSQLProvider given a valid configuration. +// +// Warning: This method may panic if the provided configuration isn't validated. +func NewStoragePostgreSQL(config *schema.Configuration, caCertPool *x509.CertPool) storage.Provider { + return storage.NewPostgreSQLProvider(config, caCertPool) +} + +// NewStorageMySQL creates a new storage.Provider using the *storage.MySQLProvider given a valid configuration. +// +// Warning: This method may panic if the provided configuration isn't validated. +func NewStorageMySQL(config *schema.Configuration, caCertPool *x509.CertPool) storage.Provider { + return storage.NewMySQLProvider(config, caCertPool) +} + +// NewStorageSQLite creates a new storage.Provider using the *storage.SQLiteProvider given a valid configuration. +// +// Warning: This method may panic if the provided configuration isn't validated. +func NewStorageSQLite(config *schema.Configuration) storage.Provider { + return storage.NewSQLiteProvider(config) +} |
