...
1 package verify
2
3 import (
4 "bytes"
5 "html/template"
6 "net/http"
7
8 "github.com/gin-gonic/gin"
9
10 "edge-infra.dev/pkg/edge/iam/verify/templates"
11 )
12
13 func begin(ctx *gin.Context) {
14 t, err := template.New("").Parse(templates.Register)
15 tpl := template.Must(t, err)
16 var w bytes.Buffer
17 _ = tpl.Execute(&w, "")
18
19
20 ctx.Data(http.StatusOK, gin.MIMEHTML, w.Bytes())
21 }
22
23 func choose(ctx *gin.Context) {
24 t, err := template.New("").Parse(templates.Choose)
25 tpl := template.Must(t, err)
26 var w bytes.Buffer
27 _ = tpl.Execute(&w, "")
28
29
30 ctx.Data(http.StatusOK, gin.MIMEHTML, w.Bytes())
31 }
32
33 func custom(ctx *gin.Context) {
34 t, err := template.New("").Parse(templates.Customize)
35 tpl := template.Must(t, err)
36 var w bytes.Buffer
37 _ = tpl.Execute(&w, "")
38
39
40 ctx.Data(http.StatusOK, gin.MIMEHTML, w.Bytes())
41 }
42
View as plain text