mirror of
https://github.com/fhmq/hmq.git
synced 2026-05-02 14:28:34 +00:00
* modify * update * add acl * add feature * update dockerfile * add deploy * update * update * plugins * plugins * update * update * update * fixed * remove * fixed * add log * update * fixed * update * fix config * add http api * add http api * resp * add config for work chan * update * fixed * update * disable trace * fixed * change acl * fixed * fixed res * dd * dd * ddd * dd * update * fixed * update * add * fixed * update key * add log * update * format * update * update auth * update * update readme * added * update * fixed * fixed * fix * upade * update * update
27 lines
464 B
Go
27 lines
464 B
Go
package broker
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func InitHTTPMoniter(b *Broker) {
|
|
gin.SetMode(gin.ReleaseMode)
|
|
router := gin.Default()
|
|
router.DELETE("api/v1/connections/:clientid", func(c *gin.Context) {
|
|
clientid := c.Param("clientid")
|
|
cli, ok := b.clients.Load(clientid)
|
|
if ok {
|
|
conn, succss := cli.(*client)
|
|
if succss {
|
|
conn.Close()
|
|
}
|
|
}
|
|
resp := map[string]int{
|
|
"code": 0,
|
|
}
|
|
c.JSON(200, &resp)
|
|
})
|
|
|
|
router.Run(":8080")
|
|
}
|