url-shortener/pkg/postgres/option.go

18 lines
273 B
Go
Raw Permalink Normal View History

2024-09-23 10:27:21 -07:00
package postgres
import "time"
type Option func(*postgres)
func ConnAttempts(attempts int) Option {
return func(p *postgres) {
p.connAttempts = attempts
}
}
func ConnTimeout(timeout time.Duration) Option {
return func(p *postgres) {
p.connTimeout = timeout
}
}