diff --git a/internal/server/backend.go b/cmd/routed/backend.go similarity index 99% rename from internal/server/backend.go rename to cmd/routed/backend.go index 6ab792b..49346d4 100644 --- a/internal/server/backend.go +++ b/cmd/routed/backend.go @@ -1,4 +1,4 @@ -package server +package main import ( "git.xeserv.us/xena/route/internal/tun2" diff --git a/internal/server/common.go b/cmd/routed/common.go similarity index 98% rename from internal/server/common.go rename to cmd/routed/common.go index 281bf37..54d5096 100644 --- a/internal/server/common.go +++ b/cmd/routed/common.go @@ -1,4 +1,4 @@ -package server +package main import ( "context" diff --git a/cmd/routed/main.go b/cmd/routed/main.go index 3ecba22..bb5bbaa 100644 --- a/cmd/routed/main.go +++ b/cmd/routed/main.go @@ -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, diff --git a/internal/server/route.go b/cmd/routed/route.go similarity index 99% rename from internal/server/route.go rename to cmd/routed/route.go index 26fb803..f2b8e39 100644 --- a/internal/server/route.go +++ b/cmd/routed/route.go @@ -1,4 +1,4 @@ -package server +package main import ( "git.xeserv.us/xena/route/internal/elfs" diff --git a/internal/server/server.go b/cmd/routed/server.go similarity index 99% rename from internal/server/server.go rename to cmd/routed/server.go index 83096bd..3f6304f 100644 --- a/internal/server/server.go +++ b/cmd/routed/server.go @@ -1,4 +1,4 @@ -package server +package main import ( "crypto/tls" diff --git a/internal/server/server_test.go b/cmd/routed/server_test.go similarity index 97% rename from internal/server/server_test.go rename to cmd/routed/server_test.go index 506fdb3..5b4b713 100644 --- a/internal/server/server_test.go +++ b/cmd/routed/server_test.go @@ -1,4 +1,4 @@ -package server +package main import ( "net/http" diff --git a/internal/server/storage.go b/cmd/routed/storage.go similarity index 97% rename from internal/server/storage.go rename to cmd/routed/storage.go index da63ea0..42de254 100644 --- a/internal/server/storage.go +++ b/cmd/routed/storage.go @@ -1,4 +1,4 @@ -package server +package main import ( "context" diff --git a/internal/server/token.go b/cmd/routed/token.go similarity index 99% rename from internal/server/token.go rename to cmd/routed/token.go index a7bc1f1..52d101b 100644 --- a/internal/server/token.go +++ b/cmd/routed/token.go @@ -1,4 +1,4 @@ -package server +package main import ( proto "git.xeserv.us/xena/route/proto"