mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 21:51:23 +08:00
35 lines
536 B
Go
35 lines
536 B
Go
package dialer
|
|
|
|
import "go.uber.org/atomic"
|
|
|
|
var (
|
|
DefaultOptions []Option
|
|
DefaultInterface = atomic.NewString("")
|
|
)
|
|
|
|
type option struct {
|
|
interfaceName string
|
|
addrReuse bool
|
|
routingMark int
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
func WithRoutingMark(mark int) Option {
|
|
return func(opt *option) {
|
|
opt.routingMark = mark
|
|
}
|
|
}
|