mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Fix session bug, fix dummy adapter, fix mobile framework builds
This commit is contained in:
parent
047717abf2
commit
58f5cc88d0
5 changed files with 58 additions and 45 deletions
|
@ -2,6 +2,7 @@ package yggdrasil
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"time"
|
||||
|
@ -170,13 +171,15 @@ func BuildVersion() string {
|
|||
// the router. The adapter must implement the standard
|
||||
// adapter.adapterImplementation interface and should extend the adapter.Adapter
|
||||
// struct.
|
||||
func (c *Core) SetRouterAdapter(adapter interface{}) {
|
||||
func (c *Core) SetRouterAdapter(adapter interface{}) error {
|
||||
// We do this because adapterImplementation is not a valid type for the
|
||||
// gomobile bindings so we just ask for a generic interface and try to cast it
|
||||
// to adapterImplementation instead
|
||||
if a, ok := adapter.(adapterImplementation); ok {
|
||||
c.router.adapter = a
|
||||
return nil
|
||||
}
|
||||
return errors.New("unsuitable adapter")
|
||||
}
|
||||
|
||||
// Start starts up Yggdrasil using the provided config.NodeConfig, and outputs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue