Browse Source

fasthttp: removed automatically generated template files - generate them on the fly during setup

Aliaksandr Valialkin 9 years ago
parent
commit
0ab58a4e38

+ 1 - 0
frameworks/Go/fasthttp-mysql/setup.sh

@@ -9,5 +9,6 @@ go get -u github.com/valyala/fasthttp
 go get -u github.com/valyala/quicktemplate/...
 go get -u github.com/valyala/quicktemplate/...
 
 
 rm -f ./server
 rm -f ./server
+go generate
 go build -o server
 go build -o server
 ./server &
 ./server &

+ 1 - 0
frameworks/Go/fasthttp-mysql/setup_prefork.sh

@@ -9,5 +9,6 @@ go get -u github.com/valyala/fasthttp
 go get -u github.com/valyala/quicktemplate/...
 go get -u github.com/valyala/quicktemplate/...
 
 
 rm -f ./server
 rm -f ./server
+go generate
 go build -o server
 go build -o server
 ./server -prefork &
 ./server -prefork &

+ 0 - 1
frameworks/Go/fasthttp-mysql/source_code

@@ -1,4 +1,3 @@
 ./fasthttp-mysql/server.go
 ./fasthttp-mysql/server.go
 ./fasthttp-mysql/templates/
 ./fasthttp-mysql/templates/
 ./fasthttp-mysql/templates/fortune.qtpl
 ./fasthttp-mysql/templates/fortune.qtpl
-./fasthttp-mysql/templates/fortune.qtpl.go

+ 1 - 2
frameworks/Go/fasthttp-mysql/templates/fortune.qtpl

@@ -5,8 +5,7 @@ type Fortune struct {
 }
 }
 %}
 %}
 
 
-{% func FortunePage(rows []Fortune) %}
-<!DOCTYPE html>
+{% func FortunePage(rows []Fortune) %}<!DOCTYPE html>
 <html>
 <html>
 <head>
 <head>
 <title>Fortunes</title>
 <title>Fortunes</title>

+ 0 - 88
frameworks/Go/fasthttp-mysql/templates/fortune.qtpl.go

@@ -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
-}

+ 1 - 0
frameworks/Go/fasthttp-postgresql/setup.sh

@@ -9,5 +9,6 @@ go get -u github.com/valyala/fasthttp
 go get -u github.com/valyala/quicktemplate/...
 go get -u github.com/valyala/quicktemplate/...
 
 
 rm -f ./server
 rm -f ./server
+go generate
 go build -o server
 go build -o server
 ./server &
 ./server &

+ 1 - 0
frameworks/Go/fasthttp-postgresql/setup_prefork.sh

@@ -9,5 +9,6 @@ go get -u github.com/valyala/fasthttp
 go get -u github.com/valyala/quicktemplate/...
 go get -u github.com/valyala/quicktemplate/...
 
 
 rm -f ./server
 rm -f ./server
+go generate
 go build -o server
 go build -o server
 ./server -prefork &
 ./server -prefork &

+ 0 - 1
frameworks/Go/fasthttp-postgresql/source_code

@@ -1,4 +1,3 @@
 ./fasthttp-postgresql/server.go
 ./fasthttp-postgresql/server.go
 ./fasthttp-postgresql/templates/
 ./fasthttp-postgresql/templates/
 ./fasthttp-postgresql/templates/fortune.qtpl
 ./fasthttp-postgresql/templates/fortune.qtpl
-./fasthttp-postgresql/templates/fortune.qtpl.go

+ 1 - 2
frameworks/Go/fasthttp-postgresql/templates/fortune.qtpl

@@ -5,8 +5,7 @@ type Fortune struct {
 }
 }
 %}
 %}
 
 
-{% func FortunePage(rows []Fortune) %}
-<!DOCTYPE html>
+{% func FortunePage(rows []Fortune) %}<!DOCTYPE html>
 <html>
 <html>
 <head>
 <head>
 <title>Fortunes</title>
 <title>Fortunes</title>

+ 0 - 88
frameworks/Go/fasthttp-postgresql/templates/fortune.qtpl.go

@@ -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      int32
-	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(int(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
-}