BeforeConnect sets the function to be invoked before a connection is established.
(fn func(context.Context, *Config) error)
| 122 | |
| 123 | // BeforeConnect sets the function to be invoked before a connection is established. |
| 124 | func BeforeConnect(fn func(context.Context, *Config) error) Option { |
| 125 | return func(cfg *Config) error { |
| 126 | cfg.beforeConnect = fn |
| 127 | return nil |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | // EnableCompress sets the compression mode. |
| 132 | func EnableCompression(yes bool) Option { |
no outgoing calls