mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-25 21:51:38 +00:00
convert to go module
This commit is contained in:
parent
caa7b739af
commit
586781b49c
16
build
16
build
@ -7,20 +7,16 @@ do
|
|||||||
d) DEBUG=true;;
|
d) DEBUG=true;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
export GOPATH=$PWD
|
|
||||||
echo "Downloading..."
|
echo "Downloading..."
|
||||||
go get -d -v
|
for CMD in `ls cmd/` ; do
|
||||||
go get -d -v yggdrasil
|
echo "Building: $CMD"
|
||||||
for file in *.go ; do
|
IMPRINT="-X github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil.buildName=$(sh contrib/semver/name.sh) -X github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil.buildVersion=$(sh contrib/semver/version.sh)"
|
||||||
echo "Building: $file"
|
|
||||||
#go build $@ $file
|
|
||||||
IMPRINT="-X yggdrasil.buildName=$(sh contrib/semver/name.sh) -X yggdrasil.buildVersion=$(sh contrib/semver/version.sh)"
|
|
||||||
if [ $DEBUG ]; then
|
if [ $DEBUG ]; then
|
||||||
go build -ldflags="$IMPRINT" -tags debug -v $file
|
go build -ldflags="$IMPRINT" -tags debug -v ./cmd/$CMD
|
||||||
else
|
else
|
||||||
go build -ldflags="$IMPRINT -s -w" -v $file
|
go build -ldflags="$IMPRINT -s -w" -v ./cmd/$CMD
|
||||||
fi
|
fi
|
||||||
if [ $UPX ]; then
|
if [ $UPX ]; then
|
||||||
upx --brute ${file%.go}
|
upx --brute $CMD
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"github.com/neilalexander/hjson-go"
|
"github.com/neilalexander/hjson-go"
|
||||||
|
|
||||||
"yggdrasil"
|
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||||
"yggdrasil/config"
|
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||||
"yggdrasil/defaults"
|
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||||
)
|
)
|
||||||
|
|
||||||
type nodeConfig = config.NodeConfig
|
type nodeConfig = config.NodeConfig
|
@ -1,17 +1,19 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "errors"
|
import (
|
||||||
import "flag"
|
"encoding/json"
|
||||||
import "fmt"
|
"errors"
|
||||||
import "strings"
|
"flag"
|
||||||
import "net"
|
"fmt"
|
||||||
import "net/url"
|
"net"
|
||||||
import "sort"
|
"net/url"
|
||||||
import "encoding/json"
|
"os"
|
||||||
import "strconv"
|
"sort"
|
||||||
import "os"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
import "yggdrasil/defaults"
|
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||||
|
)
|
||||||
|
|
||||||
type admin_info map[string]interface{}
|
type admin_info map[string]interface{}
|
||||||
|
|
@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/neilalexander/hjson-go"
|
"github.com/neilalexander/hjson-go"
|
||||||
"golang.org/x/text/encoding/unicode"
|
"golang.org/x/text/encoding/unicode"
|
||||||
|
|
||||||
"yggdrasil/config"
|
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type nodeConfig = config.NodeConfig
|
type nodeConfig = config.NodeConfig
|
||||||
|
14
go.mod
Normal file
14
go.mod
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module github.com/yggdrasil-network/yggdrasil-go
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/docker/libcontainer v2.2.1+incompatible
|
||||||
|
github.com/kardianos/minwinsvc v0.0.0-20151122163309-cad6b2b879b0
|
||||||
|
github.com/mitchellh/mapstructure v1.1.2
|
||||||
|
github.com/neilalexander/hjson-go v3.0.0+incompatible
|
||||||
|
github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091
|
||||||
|
github.com/yggdrasil-network/water v0.0.0-20180615095340-f732c88f34ae
|
||||||
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
|
||||||
|
golang.org/x/net v0.0.0-20181207154023-610586996380
|
||||||
|
golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e
|
||||||
|
golang.org/x/text v0.3.0
|
||||||
|
)
|
20
go.sum
Normal file
20
go.sum
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
github.com/docker/libcontainer v2.2.1+incompatible h1:++SbbkCw+X8vAd4j2gOCzZ2Nn7s2xFALTf7LZKmM1/0=
|
||||||
|
github.com/docker/libcontainer v2.2.1+incompatible/go.mod h1:osvj61pYsqhNCMLGX31xr7klUBhHb/ZBuXS0o1Fvwbw=
|
||||||
|
github.com/kardianos/minwinsvc v0.0.0-20151122163309-cad6b2b879b0 h1:YnZmFjg0Nvk8851WTVWlqMC1ecJH07Ctz+Ezxx4u54g=
|
||||||
|
github.com/kardianos/minwinsvc v0.0.0-20151122163309-cad6b2b879b0/go.mod h1:rUi0/YffDo1oXBOGn1KRq7Fr07LX48XEBecQnmwjsAo=
|
||||||
|
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||||
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
|
github.com/neilalexander/hjson-go v3.0.0+incompatible h1:MRqki7QoLwAe9kD12DF4yy6r04KKxvjBcMGvVGNNQ8g=
|
||||||
|
github.com/neilalexander/hjson-go v3.0.0+incompatible/go.mod h1:l+Zao6IpQ+6d/y7LnYnOfbfOeU/9xRiTi4HLVpnkcTg=
|
||||||
|
github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091 h1:1zN6ImoqhSJhN8hGXFaJlSC8msLmIbX8bFqOfWLKw0w=
|
||||||
|
github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091/go.mod h1:N20Z5Y8oye9a7HmytmZ+tr8Q2vlP0tAHP13kTHzwvQY=
|
||||||
|
github.com/yggdrasil-network/water v0.0.0-20180615095340-f732c88f34ae h1:MYCANF1kehCG6x6G+/9txLfq6n3lS5Vp0Mxn1hdiBAc=
|
||||||
|
github.com/yggdrasil-network/water v0.0.0-20180615095340-f732c88f34ae/go.mod h1:R0SBCsugm+Sf1katgTb2t7GXMm+nRIv43tM4VDZbaOs=
|
||||||
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
|
||||||
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/net v0.0.0-20181207154023-610586996380 h1:zPQexyRtNYBc7bcHmehl1dH6TB3qn8zytv8cBGLDNY0=
|
||||||
|
golang.org/x/net v0.0.0-20181207154023-610586996380/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e h1:njOxP/wVblhCLIUhjHXf6X+dzTt5OQ3vMQo9mkOIKIo=
|
||||||
|
golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||||
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
@ -16,7 +16,7 @@ import "encoding/hex"
|
|||||||
import "flag"
|
import "flag"
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import "runtime"
|
import "runtime"
|
||||||
import . "yggdrasil"
|
import . "github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||||
|
|
||||||
var doSig = flag.Bool("sig", false, "generate new signing keys instead")
|
var doSig = flag.Bool("sig", false, "generate new signing keys instead")
|
||||||
|
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export GOPATH=$PWD
|
|
||||||
go get -d yggdrasil
|
|
||||||
go run -tags debug misc/sim/treesim.go "$@"
|
go run -tags debug misc/sim/treesim.go "$@"
|
||||||
|
@ -12,7 +12,7 @@ import "runtime"
|
|||||||
import "runtime/pprof"
|
import "runtime/pprof"
|
||||||
import "flag"
|
import "flag"
|
||||||
|
|
||||||
import . "yggdrasil"
|
import . "github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"yggdrasil/defaults"
|
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: Add authentication
|
// TODO: Add authentication
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"yggdrasil/config"
|
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||||
"yggdrasil/defaults"
|
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||||
)
|
)
|
||||||
|
|
||||||
var buildName string
|
var buildName string
|
||||||
|
@ -22,7 +22,7 @@ import "net/http"
|
|||||||
import "runtime"
|
import "runtime"
|
||||||
import "os"
|
import "os"
|
||||||
|
|
||||||
import "yggdrasil/defaults"
|
import "github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||||
|
|
||||||
// Start the profiler in debug builds, if the required environment variable is set.
|
// Start the profiler in debug builds, if the required environment variable is set.
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -6,10 +6,11 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
"yggdrasil/defaults"
|
|
||||||
|
|
||||||
"github.com/songgao/packets/ethernet"
|
"github.com/songgao/packets/ethernet"
|
||||||
"github.com/yggdrasil-network/water"
|
"github.com/yggdrasil-network/water"
|
||||||
|
|
||||||
|
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||||
)
|
)
|
||||||
|
|
||||||
const tun_IPv6_HEADER_LENGTH = 40
|
const tun_IPv6_HEADER_LENGTH = 40
|
||||||
|
Loading…
Reference in New Issue
Block a user