config: add Dialer field to ConnectionConfig and PoolConfig with option constructors
This commit is contained in:
@@ -2,6 +2,7 @@ package honeybee
|
||||
|
||||
import (
|
||||
"git.wisehodl.dev/jay/go-honeybee/transport"
|
||||
"git.wisehodl.dev/jay/go-honeybee/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -17,6 +18,7 @@ type PoolConfig struct {
|
||||
ConnectionConfig transport.ConnectionConfig
|
||||
WorkerFactory WorkerFactory
|
||||
WorkerConfig WorkerConfig
|
||||
Dialer types.Dialer
|
||||
}
|
||||
|
||||
type PoolOption func(*PoolConfig) error
|
||||
@@ -122,6 +124,13 @@ func WithWorkerConfig(wc WorkerConfig) PoolOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithPoolDialer(d types.Dialer) PoolOption {
|
||||
return func(c *PoolConfig) error {
|
||||
c.Dialer = d
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithWorkerFactory(wf WorkerFactory) PoolOption {
|
||||
return func(c *PoolConfig) error {
|
||||
c.WorkerFactory = wf
|
||||
|
||||
Reference in New Issue
Block a user