(c *gin.Context, resp dto.ResponsesStreamResponse, data string)
| 54 | } |
| 55 | |
| 56 | func ResponseChunkData(c *gin.Context, resp dto.ResponsesStreamResponse, data string) { |
| 57 | c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("event: %s\n", resp.Type)}) |
| 58 | c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("data: %s", data)}) |
| 59 | if flusher, ok := c.Writer.(http.Flusher); ok { |
| 60 | flusher.Flush() |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func StringData(c *gin.Context, str string) error { |
| 65 | //str = strings.TrimPrefix(str, "data: ") |
no test coverage detected