Feature: add dhcp type dns client (#1509)
This commit is contained in:
31
component/dialer/options.go
Normal file
31
component/dialer/options.go
Normal file
@ -0,0 +1,31 @@
|
||||
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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user