mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 08:37:10 +08:00
✨ 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:
@@ -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",
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user