mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 05:31:18 +08:00
28 lines
418 B
Go
28 lines
418 B
Go
package dialer
|
|
|
|
import "go.uber.org/atomic"
|
|
|
|
var (
|
|
DefaultOptions []Option
|
|
DefaultInterface = atomic.NewString("")
|
|
)
|
|
|
|
type option struct {
|
|
interfaceName string
|
|
addrReuse bool
|
|
}
|
|
|
|
type Option func(opt *option)
|
|
|
|
func WithInterface(name string) Option {
|
|
return func(opt *option) {
|
|
opt.interfaceName = name
|
|
}
|
|
}
|
|
|
|
func WithAddrReuse(reuse bool) Option {
|
|
return func(opt *option) {
|
|
opt.addrReuse = reuse
|
|
}
|
|
}
|