1
0
forked from extern/smegmesh
smegmesh/cmd/wgmeshd/main.go

25 lines
511 B
Go
Raw Normal View History

package main
import (
2023-09-19 14:45:49 +02:00
"fmt"
ctrlserver "github.com/tim-beatham/wgmesh/pkg/ctrlserver"
"github.com/tim-beatham/wgmesh/pkg/ctrlserver/api"
2023-09-18 18:00:43 +02:00
"github.com/tim-beatham/wgmesh/pkg/ctrlserver/ipc"
2023-09-19 14:45:49 +02:00
wg "github.com/tim-beatham/wgmesh/pkg/wg"
)
func main() {
2023-09-19 14:45:49 +02:00
wgClient, err := wg.CreateClient("wgmesh")
if err != nil {
fmt.Println(err)
return
}
ctrlServer := ctrlserver.NewCtrlServer("0.0.0.0", 21910, wgClient)
ipc.RunIpcHandler(ctrlServer)
r := api.RunAPI(ctrlServer)
r.Run(ctrlServer.GetEndpoint())
}