mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-26 00:21:54 +08:00
release revsuit vBeta0.1.0 (#15)
Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
@@ -27,9 +27,8 @@ func ping(c *gin.Context) {
|
||||
}
|
||||
|
||||
func events(c *gin.Context) {
|
||||
log.Info("Receive connection from %v", c.Request.RemoteAddr)
|
||||
log.Info("Receive client connection from %v", c.Request.RemoteAddr)
|
||||
c.Stream(func(w io.Writer) bool {
|
||||
c.SSEvent("message", "connect succeed")
|
||||
select {
|
||||
case <-c.Writer.CloseNotify():
|
||||
return false
|
||||
@@ -38,7 +37,7 @@ func events(c *gin.Context) {
|
||||
}
|
||||
return true
|
||||
})
|
||||
log.Info(c.Request.RemoteAddr, "disconnect")
|
||||
log.Info("Client %s disconnect", c.Request.RemoteAddr)
|
||||
}
|
||||
|
||||
func recovery(c *gin.Context) {
|
||||
@@ -85,3 +84,11 @@ func recovery(c *gin.Context) {
|
||||
}()
|
||||
c.Next()
|
||||
}
|
||||
|
||||
func version(c *gin.Context) {
|
||||
c.JSON(200, gin.H{
|
||||
"status": "succeed",
|
||||
"error": nil,
|
||||
"result": VERSION,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user