mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 10:05:17 +00:00
rename src/yggdrasil to src/core
This commit is contained in:
parent
0343dad934
commit
018f35d9a2
@ -26,15 +26,15 @@ import (
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/core"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/module"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/multicast"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/tuntap"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/version"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
)
|
||||
|
||||
type node struct {
|
||||
core yggdrasil.Core
|
||||
core core.Core
|
||||
state *config.NodeState
|
||||
tuntap module.Module // tuntap.TunAdapter
|
||||
multicast module.Module // multicast.Multicast
|
||||
|
@ -14,13 +14,13 @@ import (
|
||||
"github.com/gologme/log"
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/core"
|
||||
)
|
||||
|
||||
// TODO: Add authentication
|
||||
|
||||
type AdminSocket struct {
|
||||
core *yggdrasil.Core
|
||||
core *core.Core
|
||||
log *log.Logger
|
||||
listenaddr string
|
||||
listener net.Listener
|
||||
@ -63,7 +63,7 @@ func (a *AdminSocket) AddHandler(name string, args []string, handlerfunc func(js
|
||||
}
|
||||
|
||||
// Init runs the initial admin setup.
|
||||
func (a *AdminSocket) Init(c *yggdrasil.Core, state *config.NodeState, log *log.Logger, options interface{}) error {
|
||||
func (a *AdminSocket) Init(c *core.Core, state *config.NodeState, log *log.Logger, options interface{}) error {
|
||||
a.core = c
|
||||
a.log = log
|
||||
a.handlers = make(map[string]handler)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"crypto/ed25519"
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"crypto/ed25519"
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"bytes"
|
@ -1,6 +1,6 @@
|
||||
// +build debug
|
||||
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import "fmt"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Package yggdrasil implements the core functionality of the Yggdrasil Network.
|
||||
Package core implements the core functionality of the Yggdrasil Network.
|
||||
|
||||
Introduction
|
||||
|
||||
@ -34,11 +34,11 @@ This may look something like this:
|
||||
"os"
|
||||
"github.com/gologme/log"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/core"
|
||||
)
|
||||
|
||||
type node struct {
|
||||
core yggdrasil.Core
|
||||
core core.Core
|
||||
config *config.NodeConfig
|
||||
log *log.Logger
|
||||
}
|
||||
@ -173,4 +173,4 @@ then you should manually implement acknowledgement and retransmission of
|
||||
messages.
|
||||
|
||||
*/
|
||||
package yggdrasil
|
||||
package core
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"crypto/ed25519"
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
// This sends packets to peers using TCP as a transport
|
||||
// It's generally better tested than the UDP implementation
|
@ -1,6 +1,6 @@
|
||||
// +build darwin
|
||||
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"syscall"
|
@ -1,6 +1,6 @@
|
||||
// +build linux
|
||||
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"syscall"
|
@ -1,6 +1,6 @@
|
||||
// +build !darwin,!linux
|
||||
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"syscall"
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
import (
|
||||
"bytes"
|
@ -1,4 +1,4 @@
|
||||
package yggdrasil
|
||||
package core
|
||||
|
||||
// This file contains the version metadata struct
|
||||
// Used in the initial connection setup and key exchange
|
@ -5,13 +5,13 @@ import (
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/admin"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/core"
|
||||
)
|
||||
|
||||
// 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
|
||||
Init(core *core.Core, state *config.NodeState, log *log.Logger, options interface{}) error
|
||||
Start() error
|
||||
Stop() error
|
||||
SetupAdminHandlers(a *admin.AdminSocket)
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
"github.com/gologme/log"
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/core"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
@ -21,7 +21,7 @@ import (
|
||||
// automatically.
|
||||
type Multicast struct {
|
||||
phony.Inbox
|
||||
core *yggdrasil.Core
|
||||
core *core.Core
|
||||
config *config.NodeState
|
||||
log *log.Logger
|
||||
sock *ipv6.PacketConn
|
||||
@ -38,13 +38,13 @@ type interfaceInfo struct {
|
||||
}
|
||||
|
||||
type listenerInfo struct {
|
||||
listener *yggdrasil.TcpListener
|
||||
listener *core.TcpListener
|
||||
time time.Time
|
||||
interval time.Duration
|
||||
}
|
||||
|
||||
// Init prepares the multicast interface for use.
|
||||
func (m *Multicast) Init(core *yggdrasil.Core, state *config.NodeState, log *log.Logger, options interface{}) error {
|
||||
func (m *Multicast) Init(core *core.Core, state *config.NodeState, log *log.Logger, options interface{}) error {
|
||||
m.core = core
|
||||
m.config = state
|
||||
m.log = log
|
||||
|
@ -22,8 +22,8 @@ import (
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/address"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/core"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||
)
|
||||
|
||||
type MTU uint16
|
||||
@ -33,7 +33,7 @@ type MTU uint16
|
||||
// should pass this object to the yggdrasil.SetRouterAdapter() function before
|
||||
// calling yggdrasil.Start().
|
||||
type TunAdapter struct {
|
||||
core *yggdrasil.Core
|
||||
core *core.Core
|
||||
store keyStore
|
||||
config *config.NodeState
|
||||
log *log.Logger
|
||||
@ -103,7 +103,7 @@ func MaximumMTU() uint64 {
|
||||
|
||||
// Init initialises the TUN module. You must have acquired a Listener from
|
||||
// the Yggdrasil core before this point and it must not be in use elsewhere.
|
||||
func (tun *TunAdapter) Init(core *yggdrasil.Core, config *config.NodeState, log *log.Logger, options interface{}) error {
|
||||
func (tun *TunAdapter) Init(core *core.Core, config *config.NodeState, log *log.Logger, options interface{}) error {
|
||||
tun.core = core
|
||||
tun.store.init(tun)
|
||||
tun.config = config
|
||||
|
Loading…
Reference in New Issue
Block a user