mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-06 22:44:05 +00:00
Define module.Module interface, update admin/tuntap/multicast modules to comply with it, fix #581
This commit is contained in:
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
|
||||
}
|
Reference in New Issue
Block a user