elasticstream/controller/read.go

19 lines
264 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"
)
func Read(c *gin.Context) {
// Read data from the client
2024-10-07 16:26:41 +05:30
data, err := client.Read(c)
2024-10-07 15:25:13 +05:30
if err != nil {
c.Status(http.StatusInternalServerError)
return
}
c.JSON(http.StatusOK, data)
}