Download pkg/utils/gin_writer_wrapper.go from ls-ylm/ls: direct link, hf CLI and curl.
- Browser
- Download file 369 Bytes
-
https://huggingface.co/spaces/ls-ylm/ls/resolve/main/pkg/utils/gin_writer_wrapper.go
- Command line
-
hf download hf://spaces/ls-ylm/ls/pkg/utils/gin_writer_wrapper.go
-
curl -L -o gin_writer_wrapper.go https://huggingface.co/spaces/ls-ylm/ls/resolve/main/pkg/utils/gin_writer_wrapper.go
369 Bytes
| package utils | |
| import "github.com/gin-gonic/gin" | |
| type GinCustomWriter struct { | |
| gin.ResponseWriter | |
| customCode int | |
| } | |
| func NewGinCustomWriter(c *gin.Context, code int) *GinCustomWriter { | |
| return &GinCustomWriter{ | |
| ResponseWriter: c.Writer, | |
| customCode: code, | |
| } | |
| } | |
| func (w *GinCustomWriter) WriteHeader(code int) { | |
| w.ResponseWriter.WriteHeader(w.customCode) | |
| } | |