This repository has been archived on 2024-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
2021-10-10 23:44:09 +08:00

30 lines
461 B
Go

package dialer
var DefaultOptions []Option
type config struct {
skipDefault bool
interfaceName string
addrReuse bool
}
type Option func(opt *config)
func WithInterface(name string) Option {
return func(opt *config) {
opt.interfaceName = name
}
}
func WithAddrReuse(reuse bool) Option {
return func(opt *config) {
opt.addrReuse = reuse
}
}
func WithSkipDefault(skip bool) Option {
return func(opt *config) {
opt.skipDefault = skip
}
}