elasticstream/controller/teardown.go

21 lines
315 B
Go

package controller
import (
"elasticstream/source/elastic"
"github.com/elastic/go-elasticsearch/v8"
"github.com/gin-gonic/gin"
)
func Teardown(c *gin.Context) {
// Close connection
err := client.Teardown()
if err != nil {
c.Status(http.StatusInternalServerError)
return
}
c.Status(http.StatusOK)
}