unified-push-xmpp/gateway/web.go

31 lines
739 B
Go
Raw Permalink Normal View History

2021-09-12 12:14:09 +02:00
package main
import (
"dev.sum7.eu/genofire/golang-lib/web"
"dev.sum7.eu/genofire/golang-lib/web/api/status"
"dev.sum7.eu/genofire/golang-lib/web/metrics"
2021-09-14 01:32:37 +02:00
"github.com/gin-gonic/gin"
2021-09-12 12:14:09 +02:00
)
// Bind to webservice
// @title UnifiedPush API for XMPP
// @version 1.0
// @description This is the first version of an UnifiedPush Gateway for XMPP
// @termsOfService http://swagger.io/terms/
// -host up.chat.sum7.eu
// @BasePath /
//
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
2021-09-14 01:32:37 +02:00
func Bind(xmpp *XMPPService, jwt JWTSecret) web.ModuleRegisterFunc {
2021-09-12 12:14:09 +02:00
return func(r *gin.Engine, ws *web.Service) {
// docs.Bind(r, ws)
status.Register(r, ws)
metrics.Register(r, ws)
Get(r, ws)
2021-09-14 01:32:37 +02:00
Post(r, ws, xmpp, jwt)
2021-09-12 12:14:09 +02:00
}
}