elasticstream/controller/close.go

19 lines
250 B
Go
Raw Permalink Normal View History

2024-10-07 15:25:13 +05:30
package controller
import (
2024-10-07 16:26:41 +05:30
"net/http"
2024-10-07 15:25:13 +05:30
"github.com/gin-gonic/gin"
)
2024-10-07 16:49:36 +05:30
func Close(c *gin.Context) {
2024-10-07 15:25:13 +05:30
// Close connection
2024-10-07 16:26:41 +05:30
err := client.Teardown(c)
2024-10-07 15:25:13 +05:30
if err != nil {
c.Status(http.StatusInternalServerError)
return
}
c.Status(http.StatusOK)
}