mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Centralise platform defaults into the 'defaults' package
This commit is contained in:
parent
adc21baa28
commit
1692bd98fd
20 changed files with 169 additions and 105 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"regexp"
|
||||
|
||||
"yggdrasil/config"
|
||||
"yggdrasil/defaults"
|
||||
)
|
||||
|
||||
// The Core object represents the Yggdrasil node. You should create a Core
|
||||
|
@ -197,26 +198,31 @@ func (c *Core) AddAllowedEncryptionPublicKey(boxStr string) error {
|
|||
return c.admin.addAllowedEncryptionPublicKey(boxStr)
|
||||
}
|
||||
|
||||
// Gets the default admin listen address for your platform.
|
||||
func (c *Core) GetAdminDefaultListen() string {
|
||||
return defaults.GetDefaults().DefaultAdminListen
|
||||
}
|
||||
|
||||
// Gets the default TUN/TAP interface name for your platform.
|
||||
func (c *Core) GetTUNDefaultIfName() string {
|
||||
return getDefaults().defaultIfName
|
||||
return defaults.GetDefaults().DefaultIfName
|
||||
}
|
||||
|
||||
// Gets the default TUN/TAP interface MTU for your platform. This can be as high
|
||||
// as 65535, depending on platform, but is never lower than 1280.
|
||||
func (c *Core) GetTUNDefaultIfMTU() int {
|
||||
return getDefaults().defaultIfMTU
|
||||
return defaults.GetDefaults().DefaultIfMTU
|
||||
}
|
||||
|
||||
// Gets the maximum supported TUN/TAP interface MTU for your platform. This
|
||||
// can be as high as 65535, depending on platform, but is never lower than 1280.
|
||||
func (c *Core) GetTUNMaximumIfMTU() int {
|
||||
return getDefaults().maximumIfMTU
|
||||
return defaults.GetDefaults().MaximumIfMTU
|
||||
}
|
||||
|
||||
// Gets the default TUN/TAP interface mode for your platform.
|
||||
func (c *Core) GetTUNDefaultIfTAPMode() bool {
|
||||
return getDefaults().defaultIfTAPMode
|
||||
return defaults.GetDefaults().DefaultIfTAPMode
|
||||
}
|
||||
|
||||
// Gets the current TUN/TAP interface name.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue