template
This commit is contained in:
6
pkg/templates/error.qtpl
Normal file
6
pkg/templates/error.qtpl
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
Hello is a simple template function.
|
||||
{% func Error(err string) %}
|
||||
***Ошибка:***
|
||||
`{%s err %}`
|
||||
{% endfunc %}
|
66
pkg/templates/error.qtpl.go
Normal file
66
pkg/templates/error.qtpl.go
Normal file
@@ -0,0 +1,66 @@
|
||||
// Code generated by qtc from "error.qtpl". DO NOT EDIT.
|
||||
// See https://github.com/valyala/quicktemplate for details.
|
||||
|
||||
// Hello is a simple template function.
|
||||
|
||||
//line pkg/templates/error.qtpl:3
|
||||
package templates
|
||||
|
||||
//line pkg/templates/error.qtpl:3
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line pkg/templates/error.qtpl:3
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line pkg/templates/error.qtpl:3
|
||||
func StreamError(qw422016 *qt422016.Writer, err string) {
|
||||
//line pkg/templates/error.qtpl:3
|
||||
qw422016.N().S(`
|
||||
***Ошибка:***
|
||||
`)
|
||||
//line pkg/templates/error.qtpl:3
|
||||
qw422016.N().S("`")
|
||||
//line pkg/templates/error.qtpl:5
|
||||
qw422016.E().S(err)
|
||||
//line pkg/templates/error.qtpl:5
|
||||
qw422016.N().S(``)
|
||||
//line pkg/templates/error.qtpl:5
|
||||
qw422016.N().S("`")
|
||||
//line pkg/templates/error.qtpl:5
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
}
|
||||
|
||||
//line pkg/templates/error.qtpl:6
|
||||
func WriteError(qq422016 qtio422016.Writer, err string) {
|
||||
//line pkg/templates/error.qtpl:6
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
StreamError(qw422016, err)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
}
|
||||
|
||||
//line pkg/templates/error.qtpl:6
|
||||
func Error(err string) string {
|
||||
//line pkg/templates/error.qtpl:6
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line pkg/templates/error.qtpl:6
|
||||
WriteError(qb422016, err)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
qs422016 := string(qb422016.B)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line pkg/templates/error.qtpl:6
|
||||
return qs422016
|
||||
//line pkg/templates/error.qtpl:6
|
||||
}
|
37
pkg/templates/hello.qtpl
Normal file
37
pkg/templates/hello.qtpl
Normal file
@@ -0,0 +1,37 @@
|
||||
https://github.com/valyala/quicktemplate
|
||||
https://github.com/valyala/quicktemplate
|
||||
|
||||
{% import (
|
||||
"fmt"
|
||||
"github.com/fatih/color"
|
||||
telegram "gopkg.in/tucnak/telebot.v2"
|
||||
)
|
||||
%}
|
||||
|
||||
Приветствие пользователя
|
||||
{% func Hello(name string) %}
|
||||
Добрый день, *** {%s name %}!***
|
||||
{% endfunc %}
|
||||
|
||||
Тайтл бота
|
||||
{%func Title(bot *telegram.User,botVer float64, jira string) %}
|
||||
{% code
|
||||
d := color.New(color.FgCyan, color.Bold).SprintFunc()
|
||||
v := fmt.Sprintf("version: ",)
|
||||
v += d("v.",botVer ,"\n")
|
||||
v += fmt.Sprintf("jira: ",)
|
||||
v += d("https://",jira ,"\n")
|
||||
v += fmt.Sprintf("url: " + d(" https://t.me/"+ bot.Username))
|
||||
|
||||
%}
|
||||
_ _ _ _
|
||||
(_|_)_ __ __ _ | |__ ___ | |_
|
||||
| | | '__/ _` | | '_ \ / _ \| __|
|
||||
| | | | | (_| | | |_) | (_) | |_
|
||||
_/ |_|_| \__,_| |_.__/ \___/ \__|
|
||||
|__/
|
||||
|
||||
{%s= v %}
|
||||
|
||||
{% endfunc %}
|
||||
|
134
pkg/templates/hello.qtpl.go
Normal file
134
pkg/templates/hello.qtpl.go
Normal file
@@ -0,0 +1,134 @@
|
||||
// Code generated by qtc from "hello.qtpl". DO NOT EDIT.
|
||||
// See https://github.com/valyala/quicktemplate for details.
|
||||
|
||||
// https://github.com/valyala/quicktemplate
|
||||
// https://github.com/valyala/quicktemplate
|
||||
//
|
||||
|
||||
//line pkg/templates/hello.qtpl:4
|
||||
package templates
|
||||
|
||||
//line pkg/templates/hello.qtpl:4
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/fatih/color"
|
||||
telegram "gopkg.in/tucnak/telebot.v2"
|
||||
)
|
||||
|
||||
// Приветствие пользователя
|
||||
|
||||
//line pkg/templates/hello.qtpl:12
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line pkg/templates/hello.qtpl:12
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line pkg/templates/hello.qtpl:12
|
||||
func StreamHello(qw422016 *qt422016.Writer, name string) {
|
||||
//line pkg/templates/hello.qtpl:12
|
||||
qw422016.N().S(`
|
||||
Добрый день, *** `)
|
||||
//line pkg/templates/hello.qtpl:13
|
||||
qw422016.E().S(name)
|
||||
//line pkg/templates/hello.qtpl:13
|
||||
qw422016.N().S(`!***
|
||||
`)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
}
|
||||
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
func WriteHello(qq422016 qtio422016.Writer, name string) {
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
StreamHello(qw422016, name)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
}
|
||||
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
func Hello(name string) string {
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
WriteHello(qb422016, name)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
qs422016 := string(qb422016.B)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
return qs422016
|
||||
//line pkg/templates/hello.qtpl:14
|
||||
}
|
||||
|
||||
// Тайтл бота
|
||||
|
||||
//line pkg/templates/hello.qtpl:17
|
||||
func StreamTitle(qw422016 *qt422016.Writer, bot *telegram.User, botVer float64, jira string) {
|
||||
//line pkg/templates/hello.qtpl:17
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line pkg/templates/hello.qtpl:19
|
||||
d := color.New(color.FgCyan, color.Bold).SprintFunc()
|
||||
v := fmt.Sprintf("version: ")
|
||||
v += d("v.", botVer, "\n")
|
||||
v += fmt.Sprintf("jira: ")
|
||||
v += d("https://", jira, "\n")
|
||||
v += fmt.Sprintf("url: " + d(" https://t.me/"+bot.Username))
|
||||
|
||||
//line pkg/templates/hello.qtpl:26
|
||||
qw422016.N().S(`
|
||||
_ _ _ _
|
||||
(_|_)_ __ __ _ | |__ ___ | |_
|
||||
| | | '__/ _`)
|
||||
//line pkg/templates/hello.qtpl:26
|
||||
qw422016.N().S("`")
|
||||
//line pkg/templates/hello.qtpl:26
|
||||
qw422016.N().S(` | | '_ \ / _ \| __|
|
||||
| | | | | (_| | | |_) | (_) | |_
|
||||
_/ |_|_| \__,_| |_.__/ \___/ \__|
|
||||
|__/
|
||||
|
||||
`)
|
||||
//line pkg/templates/hello.qtpl:34
|
||||
qw422016.N().S(v)
|
||||
//line pkg/templates/hello.qtpl:34
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
}
|
||||
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
func WriteTitle(qq422016 qtio422016.Writer, bot *telegram.User, botVer float64, jira string) {
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
StreamTitle(qw422016, bot, botVer, jira)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
}
|
||||
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
func Title(bot *telegram.User, botVer float64, jira string) string {
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
WriteTitle(qb422016, bot, botVer, jira)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
qs422016 := string(qb422016.B)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
return qs422016
|
||||
//line pkg/templates/hello.qtpl:36
|
||||
}
|
Reference in New Issue
Block a user