aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/gin-gonic/gin/render/render.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2020-10-19 11:05:36 +0530
committerVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2020-10-19 11:05:36 +0530
commit9c2ad91230d72fe6d661450cc78300ea223ae2bc (patch)
tree17bd774b3f972359dfbb46248f085bbf1c6dae98 /vendor/github.com/gin-gonic/gin/render/render.go
make it better
Diffstat (limited to 'vendor/github.com/gin-gonic/gin/render/render.go')
-rw-r--r--vendor/github.com/gin-gonic/gin/render/render.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/github.com/gin-gonic/gin/render/render.go b/vendor/github.com/gin-gonic/gin/render/render.go
new file mode 100644
index 0000000..994fcd7
--- /dev/null
+++ b/vendor/github.com/gin-gonic/gin/render/render.go
@@ -0,0 +1,30 @@
+// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package render
+
+import "net/http"
+
+type Render interface {
+ Render(http.ResponseWriter) error
+}
+
+var (
+ _ Render = JSON{}
+ _ Render = IndentedJSON{}
+ _ Render = XML{}
+ _ Render = String{}
+ _ Render = Redirect{}
+ _ Render = Data{}
+ _ Render = HTML{}
+ _ HTMLRender = HTMLDebug{}
+ _ HTMLRender = HTMLProduction{}
+)
+
+func writeContentType(w http.ResponseWriter, value []string) {
+ header := w.Header()
+ if val := header["Content-Type"]; len(val) == 0 {
+ header["Content-Type"] = value
+ }
+}