mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
refactor things the router owns (dht, sessions, searches) into that struct, to make the ownership more explicit
This commit is contained in:
parent
bbcbbaf3b1
commit
9835c63818
9 changed files with 59 additions and 59 deletions
|
@ -26,10 +26,7 @@ type Core struct {
|
|||
sigPriv crypto.SigPrivKey
|
||||
switchTable switchTable
|
||||
peers peers
|
||||
sessions sessions
|
||||
router router
|
||||
dht dht
|
||||
searches searches
|
||||
link link
|
||||
log *log.Logger
|
||||
}
|
||||
|
@ -76,9 +73,9 @@ func (c *Core) init() error {
|
|||
c.log.Warnln("SigningPublicKey in config is incorrect, should be", sp)
|
||||
}
|
||||
|
||||
c.searches.init(c)
|
||||
c.dht.init(c)
|
||||
c.sessions.init(c)
|
||||
c.router.searches.init(c)
|
||||
c.router.dht.init(c)
|
||||
c.router.sessions.init(c)
|
||||
c.peers.init(c)
|
||||
c.router.init(c)
|
||||
c.switchTable.init(c) // TODO move before peers? before router?
|
||||
|
@ -124,9 +121,9 @@ func (c *Core) UpdateConfig(config *config.NodeConfig) {
|
|||
errors := 0
|
||||
|
||||
components := []chan chan error{
|
||||
c.searches.reconfigure,
|
||||
c.dht.reconfigure,
|
||||
c.sessions.reconfigure,
|
||||
c.router.searches.reconfigure,
|
||||
c.router.dht.reconfigure,
|
||||
c.router.sessions.reconfigure,
|
||||
c.peers.reconfigure,
|
||||
c.router.reconfigure,
|
||||
c.switchTable.reconfigure,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue