1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2025-09-20 12:35:59 +08:00
Files
mihomo/component/dialer/options.go

28 lines
418 B
Go
Raw Normal View History

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
}
}