mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-18 02:56:06 +00:00
move GenerateConfig to defaults, to adjust dependency ordering, needed for stuff later
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package defaults
|
||||
|
||||
import "github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
|
||||
// Defines which parameters are expected by default for configuration on a
|
||||
// specific platform. These values are populated in the relevant defaults_*.go
|
||||
// for the platform being targeted. They must be set.
|
||||
@ -18,3 +20,23 @@ type platformDefaultParameters struct {
|
||||
DefaultIfMTU uint64
|
||||
DefaultIfName string
|
||||
}
|
||||
|
||||
// Generates default configuration and returns a pointer to the resulting
|
||||
// NodeConfig. This is used when outputting the -genconf parameter and also when
|
||||
// using -autoconf.
|
||||
func GenerateConfig() *config.NodeConfig {
|
||||
// Create a node configuration and populate it.
|
||||
cfg := new(config.NodeConfig)
|
||||
cfg.NewKeys()
|
||||
cfg.Listen = []string{}
|
||||
cfg.AdminListen = GetDefaults().DefaultAdminListen
|
||||
cfg.Peers = []string{}
|
||||
cfg.InterfacePeers = map[string][]string{}
|
||||
cfg.AllowedPublicKeys = []string{}
|
||||
cfg.MulticastInterfaces = GetDefaults().DefaultMulticastInterfaces
|
||||
cfg.IfName = GetDefaults().DefaultIfName
|
||||
cfg.IfMTU = GetDefaults().DefaultIfMTU
|
||||
cfg.NodeInfoPrivacy = false
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
Reference in New Issue
Block a user