mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 05:31:18 +08:00
32 lines
466 B
Go
32 lines
466 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
|
|
}
|
|
}
|