gin/render/data.go
Manu Mtz-Almeida 947b53d4a2 New Render API
2015-05-18 15:45:24 +02:00

17 lines
259 B
Go

package render
import "net/http"
type Data struct {
ContentType string
Data []byte
}
func (r Data) Write(w http.ResponseWriter) error {
if len(r.ContentType) > 0 {
w.Header().Set("Content-Type", r.ContentType)
}
w.Write(r.Data)
return nil
}