MCPcopy Create free account
hub / github.com/aurora-develop/aurora / requestStreamFlag

Function requestStreamFlag

initialize/handlers.go:889–900  ·  view source on GitHub ↗

requestStreamFlag 解析 stream 参数,支持 JSON body 的 stream 字段或 ?stream=true 查询参数。 multipart/form-data 也支持 stream 字段(字符串 "true"/"1")。

(c *gin.Context, jsonStream bool)

Source from the content-addressed store, hash-verified

887// requestStreamFlag 解析 stream 参数,支持 JSON body 的 stream 字段或 ?stream=true 查询参数。
888// multipart/form-data 也支持 stream 字段(字符串 "true"/"1")。
889func requestStreamFlag(c *gin.Context, jsonStream bool) bool {
890 if jsonStream {
891 return true
892 }
893 if v := strings.ToLower(strings.TrimSpace(c.Query("stream"))); v == "true" || v == "1" || v == "yes" {
894 return true
895 }
896 if v := strings.ToLower(strings.TrimSpace(c.PostForm("stream"))); v == "true" || v == "1" || v == "yes" {
897 return true
898 }
899 return false
900}
901
902// isStreamTrue 把任意形式的 stream 字段值转换为 bool。
903func isStreamTrue(v string) bool {

Callers 2

imageGenerationsMethod · 0.85
runImageEditFlowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected