Skip to content
Myr

Separate type define (#983)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by 田欧 · committed by Bo-Yi Wu · parent 7387ef6 · Browse files · 2 files+28 added−32 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+28 added−32 removed

  • other:+28 added−32 removed

2 files+28 added−32 removed

modified:render/html.go+22 added-24 removed
7 unmodified lines
8 "html/template"9 "net/http"10)1112type (13 Delims struct {14 Left string15 Right string16 }12type Delims struct {13 Left string14 Right string15}1618 HTMLRender interface {19 Instance(string, interface{}) Render20 }17type HTMLRender interface {18 Instance(string, interface{}) Render19}2022 HTMLProduction struct {23 Template *template.Template24 Delims Delims25 }21type HTMLProduction struct {22 Template *template.Template23 Delims Delims24}2527 HTMLDebug struct {28 Files []string29 Glob string30 Delims Delims31 FuncMap template.FuncMap32 }26type HTMLDebug struct {27 Files []string28 Glob string29 Delims Delims30 FuncMap template.FuncMap31}3234 HTML struct {35 Template *template.Template36 Name string37 Data interface{}38 }39)33type HTML struct {34 Template *template.Template35 Name string36 Data interface{}37}3839var htmlContentType = []string{"text/html; charset=utf-8"}4041func (r HTMLProduction) Instance(name string, data interface{}) Render {
39 unmodified lines
modified:render/json.go+6 added-8 removed
7 unmodified lines
8 "encoding/json"9 "net/http"10)1112type (13 JSON struct {14 Data interface{}15 }12type JSON struct {13 Data interface{}14}1517 IndentedJSON struct {18 Data interface{}19 }20)16type IndentedJSON struct {17 Data interface{}18}1920var jsonContentType = []string{"application/json; charset=utf-8"}2122func (r JSON) Render(w http.ResponseWriter) (err error) {
33 unmodified lines