for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
package postgres
import (
"time"
)
// Option - Option type
type Option func(*Postgres)
// MaxOpenConnections - Defines maximum open connections for postgresql db
func MaxOpenConnections(size int) Option {
return func(c *Postgres) {
c.maxOpenConnections = size
}
// MaxIdleConnections - Defines maximum idle connections for postgresql db
func MaxIdleConnections(c int) Option {
return func(p *Postgres) {
p.maxIdleConnections = c
// MaxConnectionIdleTime - Defines maximum connection idle for postgresql db
func MaxConnectionIdleTime(d time.Duration) Option {
p.maxConnectionIdleTime = d
// MaxConnectionLifeTime - Defines maximum connection lifetime for postgresql db
func MaxConnectionLifeTime(d time.Duration) Option {
p.maxConnectionLifeTime = d
func MaxDataPerWrite(v int) Option {
c.maxDataPerWrite = v
func WatchBufferSize(v int) Option {
c.watchBufferSize = v
func MaxRetries(v int) Option {
c.maxRetries = v