feature: integrate SSL mode for PG connections (#77)

Right now, the default connection for postgres is `disable`. Some
databases require `verify` or even `required`.
This PR introduces a new implementation that allows the user to override
the `disable` mode. The PR keeps a backwards compatible config entry, that
sets the default behavior to `disable` if it's missing.
This commit is contained in:
Roman
2021-05-18 13:00:40 +02:00
committed by GitHub
parent b9b7ed25ca
commit 7bbbc01f84
4 changed files with 33 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ store := postgres.New(postgres.Config{
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
SslMode: "disable",
})
```
@@ -93,6 +94,11 @@ type Config struct {
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
// The SSL mode for the connection
//
// Optional. Default is "disable"
SslMode string
}
```
@@ -105,5 +111,6 @@ var ConfigDefault = Config{
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
SslMode: "disable",
}
```