2020-04-28 13:11:49 +02:00
|
|
|
package apiv1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/auth"
|
|
|
|
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/client"
|
|
|
|
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/server"
|
2020-10-06 18:14:34 +02:00
|
|
|
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/status"
|
2020-04-28 13:11:49 +02:00
|
|
|
)
|
|
|
|
|
2020-06-10 09:52:44 +02:00
|
|
|
// ApplyRoutes apply routes to gin router
|
2020-04-28 13:11:49 +02:00
|
|
|
func ApplyRoutes(r *gin.RouterGroup, private bool) {
|
|
|
|
v1 := r.Group("/v1.0")
|
|
|
|
{
|
|
|
|
if private {
|
|
|
|
client.ApplyRoutes(v1)
|
|
|
|
server.ApplyRoutes(v1)
|
2020-10-06 18:14:34 +02:00
|
|
|
status.ApplyRoutes(v1)
|
2020-04-28 13:11:49 +02:00
|
|
|
} else {
|
|
|
|
auth.ApplyRoutes(v1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|