mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 14:45:07 +03:00
Define module.Module interface, update admin/tuntap/multicast modules to comply with it, fix #581
This commit is contained in:
parent
fc71624919
commit
a072e063d8
6 changed files with 108 additions and 42 deletions
20
src/module/module.go
Normal file
20
src/module/module.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package module
|
||||
|
||||
import (
|
||||
"github.com/gologme/log"
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
)
|
||||
|
||||
// Module is an interface that defines which functions must be supported by a
|
||||
// given Yggdrasil module.
|
||||
type Module interface {
|
||||
Init(core *yggdrasil.Core, state *config.NodeState, log *log.Logger, options interface{}) error
|
||||
Start() error
|
||||
Stop() error
|
||||
UpdateConfig(config *config.NodeConfig)
|
||||
SetupAdminHandlers(a *admin.AdminSocket)
|
||||
IsStarted() bool
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue