Skip to content
Snippets Groups Projects
Commit cea69931 authored by Marvin Berstecher's avatar Marvin Berstecher
Browse files

add controllers for connections

parent 789633aa
No related branches found
No related tags found
No related merge requests found
package controllers
import (
"net/http"
"github.com/gin-gonic/gin"
)
type ConnectionController struct{}
func (cc ConnectionController) CreateConnectionEndpoint(context *gin.Context) {
context.Status(http.StatusNotImplemented)
}
func (cc ConnectionController) UpdateConnection(context *gin.Context) {
context.Status(http.StatusNotImplemented)
}
func (cc ConnectionController) DeleteConnection(context *gin.Context) {
context.Status(http.StatusNotImplemented)
}
func (cc ConnectionController) ConnectionInformation(context *gin.Context) {
context.Status(http.StatusNotImplemented)
}
func (cc ConnectionController) ConnectionStatus(context *gin.Context) {
context.Status(http.StatusNotImplemented)
}
func (cc ConnectionController) BlockConnection(context *gin.Context) {
context.Status(http.StatusNotImplemented)
}
......@@ -14,6 +14,15 @@ func NewRouter() *gin.Engine {
helloWorld := new(controllers.HelloWorldController)
router.GET("/helloworld", helloWorld.HelloWorld)
// connection
cc := new(controllers.ConnectionController)
router.PUT("/connection", cc.CreateConnectionEndpoint)
router.PATCH("/connection", cc.UpdateConnection)
router.DELETE("/connection", cc.DeleteConnection)
router.GET("/connection", cc.ConnectionInformation)
router.GET("/connection/status", cc.ConnectionStatus)
router.PUT("/connection/block", cc.BlockConnection)
// TODO: add other controllers to the router
return router
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment