🎨 调整供应商目录结构,合并文本输出函数

This commit is contained in:
Martial BE
2023-11-29 16:07:09 +08:00
parent 902c2faa2c
commit 544f20cc73
51 changed files with 1062 additions and 1146 deletions

View File

@@ -6,6 +6,8 @@ import (
"io"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
var HttpClient *http.Client
@@ -124,3 +126,11 @@ func DecodeString(body io.Reader, output *string) error {
*output = string(b)
return nil
}
func SetEventStreamHeaders(c *gin.Context) {
c.Writer.Header().Set("Content-Type", "text/event-stream")
c.Writer.Header().Set("Cache-Control", "no-cache")
c.Writer.Header().Set("Connection", "keep-alive")
c.Writer.Header().Set("Transfer-Encoding", "chunked")
c.Writer.Header().Set("X-Accel-Buffering", "no")
}