@@ -9,13 +9,38 @@ import (
9
9
"github.com/go-chi/render"
10
10
)
11
11
12
+ /*
13
+ Code based on [go-chi/render](https://github.com/go-chi/render)
14
+
15
+ Original code copyright (c) 2016-Present https://github.com/go-chi authors
16
+ Modifications copyright (c) 2024 Three Dots Labs
17
+
18
+ MIT License
19
+
20
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
21
+ this software and associated documentation files (the "Software"), to deal in
22
+ the Software without restriction, including without limitation the rights to
23
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
24
+ the Software, and to permit persons to whom the Software is furnished to do so,
25
+ subject to the following conditions:
26
+
27
+ The above copyright notice and this permission notice shall be included in all
28
+ copies or substantial portions of the Software.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
32
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
33
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
34
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
35
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36
+ */
37
+
12
38
type sseResponder struct {
13
39
marshaler SSEMarshaler
14
40
}
15
41
16
42
// Respond handles streaming JSON and XML responses, automatically setting the
17
43
// Content-Type based on request headers.
18
- // Based on go-chi/render.
19
44
func (s sseResponder ) Respond (w http.ResponseWriter , r * http.Request , v interface {}) {
20
45
if v != nil {
21
46
switch reflect .TypeOf (v ).Kind () {
0 commit comments