smegmesh/pkg/ctrlserver/api/mesh/mesh.go
Tim Beatham 01238aca59 Incorporated gin server.
Each node communicates in the mesh
2023-09-18 15:52:28 +01:00

24 lines
477 B
Go

package mesh
import (
"net/http"
"github.com/gin-gonic/gin"
ctrlserver "github.com/tim-beatham/wgmesh/pkg/ctrlserver"
)
type JoinMeshInput struct {
MeshId string `json:"mesh-id" binding:"required`
}
func JoinMesh(c *gin.Context, server *ctrlserver.MeshCtrlServer) {
var input JoinMeshInput
if err := c.ShouldBindJSON(&input); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{"status": "success"})
}