新增:频道(topic)细粒度权限控制,是否允许订阅消息、是否允许发送消息到频道

This commit is contained in:
2023-07-16 01:33:25 +08:00
parent 66772cb659
commit bf82800afc
8 changed files with 412 additions and 55 deletions

View File

@@ -28,7 +28,8 @@ func StartWatch() {
zsub.Hub.Clearup()
c.JSON(http.StatusOK, "+OK")
})
r.GET("/retimer", func(c *gin.Context) {
r.GET("/timer/reload", func(c *gin.Context) {
zsub.Hub.ReloadTimer()
c.JSON(http.StatusOK, "+reload timer ok")
})
@@ -48,6 +49,12 @@ func StartWatch() {
c.JSON(http.StatusOK, "+OK")
})
// reload the auth configuration
r.GET("/auth/reload", func(c *gin.Context) {
zsub.AuthManager.Reload()
c.JSON(http.StatusOK, "+OK")
})
watchAddr := zsub.Conf.Service.Watch
r.Run(watchAddr)
}