cmd/routed: move internal/server here
This commit is contained in:
parent
509c38b133
commit
09cb598df9
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.xeserv.us/xena/route/internal/tun2"
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.xeserv.us/xena/route/internal/elfs"
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package main
|
||||
|
||||
import (
|
||||
proto "git.xeserv.us/xena/route/proto"
|
Loading…
Reference in New Issue