Skip to content

Commit

Permalink
feat(pgdriver): allow setting Network in config
Browse files Browse the repository at this point in the history
  • Loading branch information
sdzyba committed Oct 10, 2021
1 parent e621318 commit b24b5d8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions driver/pgdriver/config.go
Expand Up @@ -71,6 +71,15 @@ func newDefaultConfig() *Config {

type DriverOption func(cfg *Config)

func WithNetwork(network string) DriverOption {
if network == "" {
panic("network is empty")
}
return func(cfg *Config) {
cfg.Network = network
}
}

func WithAddr(addr string) DriverOption {
if addr == "" {
panic("addr is empty")
Expand Down

0 comments on commit b24b5d8

Please sign in to comment.