cmd/routed: move internal/server here

This commit is contained in:
Cadey Ratio 2017-12-15 10:18:13 -08:00
parent 509c38b133
commit 09cb598df9
8 changed files with 11 additions and 12 deletions

View File

@ -1,4 +1,4 @@
package server
package main
import (
"git.xeserv.us/xena/route/internal/tun2"

View File

@ -1,4 +1,4 @@
package server
package main
import (
"context"

View File

@ -12,7 +12,6 @@ import (
_ "git.xeserv.us/xena/route/internal"
"git.xeserv.us/xena/route/internal/middleware"
"git.xeserv.us/xena/route/internal/routecrypto"
"git.xeserv.us/xena/route/internal/server"
"github.com/Xe/ln"
"github.com/caarlos0/env"
"github.com/facebookgo/flagenv"
@ -33,14 +32,14 @@ func main() {
certKey, _ := routecrypto.ParseKey(*sslCertKey)
scfg := server.Config{}
scfg := Config{}
err := env.Parse(&scfg)
if err != nil {
ln.FatalErr(ctx, err, ln.Action("parsing environment for config"))
}
scfg.CertKey = certKey
s, err := server.New(scfg)
s, err := New(scfg)
if err != nil {
ln.FatalErr(ctx, err, ln.Action("create server instance"))
}
@ -76,7 +75,7 @@ func main() {
hs.Serve(l)
}
func setupQuic(s *server.Server, scfg server.Config) {
func setupQuic(s *Server, scfg Config) {
qs := &h2quic.Server{
Server: &http.Server{
Handler: middleware.Trace(s),
@ -92,7 +91,7 @@ func setupQuic(s *server.Server, scfg server.Config) {
}
}
func setupTLS(s *server.Server, scfg server.Config) {
func setupTLS(s *Server, scfg Config) {
hs := &http.Server{
Handler: middleware.Trace(s),
Addr: scfg.SSLAddr,

View File

@ -1,4 +1,4 @@
package server
package main
import (
"git.xeserv.us/xena/route/internal/elfs"

View File

@ -1,4 +1,4 @@
package server
package main
import (
"crypto/tls"

View File

@ -1,4 +1,4 @@
package server
package main
import (
"net/http"

View File

@ -1,4 +1,4 @@
package server
package main
import (
"context"

View File

@ -1,4 +1,4 @@
package server
package main
import (
proto "git.xeserv.us/xena/route/proto"