mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
21 lines
369 B
Go
21 lines
369 B
Go
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)
|
|
}
|