mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-06 01:07:03 +08:00
41 lines
612 B
Go
Executable File
41 lines
612 B
Go
Executable File
package engine
|
|
|
|
type Option func(*Engine)
|
|
|
|
func WithDevice(device string) Option {
|
|
return func(e *Engine) {
|
|
e.rawDevice = device
|
|
}
|
|
}
|
|
|
|
func WithInterface(iface string) Option {
|
|
return func(e *Engine) {
|
|
e.iface = iface
|
|
}
|
|
}
|
|
|
|
func WithLogLevel(level string) Option {
|
|
return func(e *Engine) {
|
|
e.logLevel = level
|
|
}
|
|
}
|
|
|
|
func WithMTU(mtu int) Option {
|
|
return func(e *Engine) {
|
|
e.mtu = uint32(mtu)
|
|
}
|
|
}
|
|
|
|
func WithProxy(proxy string) Option {
|
|
return func(e *Engine) {
|
|
e.rawProxy = proxy
|
|
}
|
|
}
|
|
|
|
func WithStats(stats, token string) Option {
|
|
return func(e *Engine) {
|
|
e.stats = stats
|
|
e.token = token
|
|
}
|
|
}
|