mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 06:05:06 +03:00
20 lines
363 B
Go
20 lines
363 B
Go
package tun
|
|
|
|
func (m *TunAdapter) _applyOption(opt SetupOption) {
|
|
switch v := opt.(type) {
|
|
case InterfaceName:
|
|
m.config.name = v
|
|
case InterfaceMTU:
|
|
m.config.mtu = v
|
|
}
|
|
}
|
|
|
|
type SetupOption interface {
|
|
isSetupOption()
|
|
}
|
|
|
|
type InterfaceName string
|
|
type InterfaceMTU uint64
|
|
|
|
func (a InterfaceName) isSetupOption() {}
|
|
func (a InterfaceMTU) isSetupOption() {}
|