|
@@ -1,88 +0,0 @@
|
|
|
-// This file is automatically generated by qtc from "fortune.qtpl".
|
|
|
-// See https://github.com/valyala/quicktemplate for details.
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:1
|
|
|
-package templates
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:1
|
|
|
-import (
|
|
|
- "io"
|
|
|
-
|
|
|
- "github.com/valyala/quicktemplate"
|
|
|
-)
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:1
|
|
|
-var (
|
|
|
- _ = io.Copy
|
|
|
- _ = quicktemplate.AcquireByteBuffer
|
|
|
-)
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:2
|
|
|
-type Fortune struct {
|
|
|
- ID int
|
|
|
- Message string
|
|
|
-}
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:8
|
|
|
-func StreamFortunePage(qw *quicktemplate.Writer, rows []Fortune) {
|
|
|
- //line templates/fortune.qtpl:8
|
|
|
- qw.N().S(`
|
|
|
-<!DOCTYPE html>
|
|
|
-<html>
|
|
|
-<head>
|
|
|
-<title>Fortunes</title>
|
|
|
-</head>
|
|
|
-<body>
|
|
|
-<table>
|
|
|
-<tr><th>id</th><th>message</th></tr>
|
|
|
-`)
|
|
|
- //line templates/fortune.qtpl:17
|
|
|
- for _, r := range rows {
|
|
|
- //line templates/fortune.qtpl:17
|
|
|
- qw.N().S(`
|
|
|
-<tr><td>`)
|
|
|
- //line templates/fortune.qtpl:18
|
|
|
- qw.N().D(r.ID)
|
|
|
- //line templates/fortune.qtpl:18
|
|
|
- qw.N().S(`</td><td>`)
|
|
|
- //line templates/fortune.qtpl:18
|
|
|
- qw.E().S(r.Message)
|
|
|
- //line templates/fortune.qtpl:18
|
|
|
- qw.N().S(`</td></tr>
|
|
|
-`)
|
|
|
- //line templates/fortune.qtpl:19
|
|
|
- }
|
|
|
- //line templates/fortune.qtpl:19
|
|
|
- qw.N().S(`
|
|
|
-</table>
|
|
|
-</body>
|
|
|
-</html>
|
|
|
-`)
|
|
|
-//line templates/fortune.qtpl:23
|
|
|
-}
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:23
|
|
|
-func WriteFortunePage(qww io.Writer, rows []Fortune) {
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- qw := quicktemplate.AcquireWriter(qww)
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- StreamFortunePage(qw, rows)
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- quicktemplate.ReleaseWriter(qw)
|
|
|
-//line templates/fortune.qtpl:23
|
|
|
-}
|
|
|
-
|
|
|
-//line templates/fortune.qtpl:23
|
|
|
-func FortunePage(rows []Fortune) string {
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- qb := quicktemplate.AcquireByteBuffer()
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- WriteFortunePage(qb, rows)
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- qs := string(qb.B)
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- quicktemplate.ReleaseByteBuffer(qb)
|
|
|
- //line templates/fortune.qtpl:23
|
|
|
- return qs
|
|
|
-//line templates/fortune.qtpl:23
|
|
|
-}
|