From fdaa19f9eb565fa02caeeed308460e067e6f4ca5 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Sun, 24 Nov 2019 22:59:12 -0500 Subject: Release chores for 2.0.0 --- go.mod | 1 + go.sum | 2 + template/code.qtpl.go | 207 ++++++++++++++++++++++++++++++++++++++++++++++++ template/index.qtpl.go | 110 +++++++++++++++++++++++++ template/layout.qtpl.go | 104 ++++++++++++++++++++++++ 5 files changed, 424 insertions(+) create mode 100644 template/code.qtpl.go create mode 100644 template/index.qtpl.go create mode 100644 template/layout.qtpl.go diff --git a/go.mod b/go.mod index 1cd1ad7..debb5aa 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/fasthttp/router v0.5.2 github.com/go-redis/redis/v7 v7.0.0-beta.4 github.com/golang/protobuf v1.3.1 // indirect + github.com/klauspost/compress v1.9.2 // indirect github.com/twmb/murmur3 v1.0.0 github.com/valyala/fasthttp v1.6.0 github.com/valyala/quicktemplate v1.4.1 diff --git a/go.sum b/go.sum index 0fc0fac..a955a71 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.8.2 h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2KCcs= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.2 h1:LfVyl+ZlLlLDeQ/d2AqfGIIH4qEDu0Ed2S5GyhCWIWY= +github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= diff --git a/template/code.qtpl.go b/template/code.qtpl.go new file mode 100644 index 0000000..2fa1401 --- /dev/null +++ b/template/code.qtpl.go @@ -0,0 +1,207 @@ +// Code generated by qtc from "code.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +// The code layout. + +//line template/code.qtpl:2 +package template + +//line template/code.qtpl:2 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line template/code.qtpl:2 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line template/code.qtpl:2 +func StreamCode(qw422016 *qt422016.Writer, lang, data string) { +//line template/code.qtpl:2 + qw422016.N().S(` + `) +//line template/code.qtpl:3 + streamlayout(qw422016, " ", code_scripts(lang), "", code_contents(lang, data), code_bodyscripts(lang)) +//line template/code.qtpl:3 + qw422016.N().S(` +`) +//line template/code.qtpl:4 +} + +//line template/code.qtpl:4 +func WriteCode(qq422016 qtio422016.Writer, lang, data string) { +//line template/code.qtpl:4 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/code.qtpl:4 + StreamCode(qw422016, lang, data) +//line template/code.qtpl:4 + qt422016.ReleaseWriter(qw422016) +//line template/code.qtpl:4 +} + +//line template/code.qtpl:4 +func Code(lang, data string) string { +//line template/code.qtpl:4 + qb422016 := qt422016.AcquireByteBuffer() +//line template/code.qtpl:4 + WriteCode(qb422016, lang, data) +//line template/code.qtpl:4 + qs422016 := string(qb422016.B) +//line template/code.qtpl:4 + qt422016.ReleaseByteBuffer(qb422016) +//line template/code.qtpl:4 + return qs422016 +//line template/code.qtpl:4 +} + +//line template/code.qtpl:7 +const prefix = "https://unpkg.com/prismjs" + +// The code scripts. + +//line template/code.qtpl:11 +func streamcode_scripts(qw422016 *qt422016.Writer, lang string) { +//line template/code.qtpl:11 + qw422016.N().S(` + +`) +//line template/code.qtpl:13 +} + +//line template/code.qtpl:13 +func writecode_scripts(qq422016 qtio422016.Writer, lang string) { +//line template/code.qtpl:13 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/code.qtpl:13 + streamcode_scripts(qw422016, lang) +//line template/code.qtpl:13 + qt422016.ReleaseWriter(qw422016) +//line template/code.qtpl:13 +} + +//line template/code.qtpl:13 +func code_scripts(lang string) string { +//line template/code.qtpl:13 + qb422016 := qt422016.AcquireByteBuffer() +//line template/code.qtpl:13 + writecode_scripts(qb422016, lang) +//line template/code.qtpl:13 + qs422016 := string(qb422016.B) +//line template/code.qtpl:13 + qt422016.ReleaseByteBuffer(qb422016) +//line template/code.qtpl:13 + return qs422016 +//line template/code.qtpl:13 +} + +// The code bodyscripts. + +//line template/code.qtpl:16 +func streamcode_bodyscripts(qw422016 *qt422016.Writer, lang string) { +//line template/code.qtpl:16 + qw422016.N().S(` + `) +//line template/code.qtpl:17 + qw422016.N().S(``) +//line template/code.qtpl:19 + if lang != "" && lang != "none" { +//line template/code.qtpl:19 + qw422016.N().S(``) +//line template/code.qtpl:21 + } +//line template/code.qtpl:22 + qw422016.N().S(` +`) +//line template/code.qtpl:23 +} + +//line template/code.qtpl:23 +func writecode_bodyscripts(qq422016 qtio422016.Writer, lang string) { +//line template/code.qtpl:23 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/code.qtpl:23 + streamcode_bodyscripts(qw422016, lang) +//line template/code.qtpl:23 + qt422016.ReleaseWriter(qw422016) +//line template/code.qtpl:23 +} + +//line template/code.qtpl:23 +func code_bodyscripts(lang string) string { +//line template/code.qtpl:23 + qb422016 := qt422016.AcquireByteBuffer() +//line template/code.qtpl:23 + writecode_bodyscripts(qb422016, lang) +//line template/code.qtpl:23 + qs422016 := string(qb422016.B) +//line template/code.qtpl:23 + qt422016.ReleaseByteBuffer(qb422016) +//line template/code.qtpl:23 + return qs422016 +//line template/code.qtpl:23 +} + +// The code contents. + +//line template/code.qtpl:26 +func streamcode_contents(qw422016 *qt422016.Writer, lang, data string) { +//line template/code.qtpl:26 + qw422016.N().S(` +
`)
+//line template/code.qtpl:27
+	qw422016.E().S(data)
+//line template/code.qtpl:27
+	qw422016.N().S(`
+`) +//line template/code.qtpl:28 +} + +//line template/code.qtpl:28 +func writecode_contents(qq422016 qtio422016.Writer, lang, data string) { +//line template/code.qtpl:28 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/code.qtpl:28 + streamcode_contents(qw422016, lang, data) +//line template/code.qtpl:28 + qt422016.ReleaseWriter(qw422016) +//line template/code.qtpl:28 +} + +//line template/code.qtpl:28 +func code_contents(lang, data string) string { +//line template/code.qtpl:28 + qb422016 := qt422016.AcquireByteBuffer() +//line template/code.qtpl:28 + writecode_contents(qb422016, lang, data) +//line template/code.qtpl:28 + qs422016 := string(qb422016.B) +//line template/code.qtpl:28 + qt422016.ReleaseByteBuffer(qb422016) +//line template/code.qtpl:28 + return qs422016 +//line template/code.qtpl:28 +} diff --git a/template/index.qtpl.go b/template/index.qtpl.go new file mode 100644 index 0000000..ad7b1df --- /dev/null +++ b/template/index.qtpl.go @@ -0,0 +1,110 @@ +// Code generated by qtc from "index.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +// Index's contents. + +//line template/index.qtpl:2 +package template + +//line template/index.qtpl:2 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line template/index.qtpl:2 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line template/index.qtpl:2 +func streamindex_contents(qw422016 *qt422016.Writer) { +//line template/index.qtpl:2 + qw422016.N().S(` + `) +//line template/index.qtpl:3 + qw422016.N().S(`

Burning Rubber Paste

Usage

Method - EndpointEffect
POST / data=foo
Pastebin foo
PUT /id data=foo
Write foo into /id. Collisions disallowed. If a POST id coincides with your PUT content, it will be overwritten.
GET /id
Read paste with ID "id"
GET /id/raw
Get the raw contents of paste with ID "id"
GET /id/lang
Read paste with ID "id", and highlight it as "lang"

Examples

`) +//line template/index.qtpl:38 + qw422016.N().S(` +
http -f https://brpaste.example.com data=@file.txt
+http -f https://brpaste.example.com data=abcd
+http -f PUT https://brpaste.example.com/myPaste data=contents
+http https://brpaste.example.com/some_id/raw
+xdg-open https://brpaste.example.com/some_id/cpp
+ `) +//line template/index.qtpl:44 + qw422016.N().S(`

Paste from a browser


`) +//line template/index.qtpl:52 + qw422016.N().S(` +`) +//line template/index.qtpl:53 +} + +//line template/index.qtpl:53 +func writeindex_contents(qq422016 qtio422016.Writer) { +//line template/index.qtpl:53 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/index.qtpl:53 + streamindex_contents(qw422016) +//line template/index.qtpl:53 + qt422016.ReleaseWriter(qw422016) +//line template/index.qtpl:53 +} + +//line template/index.qtpl:53 +func index_contents() string { +//line template/index.qtpl:53 + qb422016 := qt422016.AcquireByteBuffer() +//line template/index.qtpl:53 + writeindex_contents(qb422016) +//line template/index.qtpl:53 + qs422016 := string(qb422016.B) +//line template/index.qtpl:53 + qt422016.ReleaseByteBuffer(qb422016) +//line template/index.qtpl:53 + return qs422016 +//line template/index.qtpl:53 +} + +// The index layout. + +//line template/index.qtpl:56 +func StreamIndex(qw422016 *qt422016.Writer) { +//line template/index.qtpl:56 + qw422016.N().S(` + `) +//line template/index.qtpl:57 + streamlayout(qw422016, "", "", "", index_contents(), "") +//line template/index.qtpl:57 + qw422016.N().S(` +`) +//line template/index.qtpl:58 +} + +//line template/index.qtpl:58 +func WriteIndex(qq422016 qtio422016.Writer) { +//line template/index.qtpl:58 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/index.qtpl:58 + StreamIndex(qw422016) +//line template/index.qtpl:58 + qt422016.ReleaseWriter(qw422016) +//line template/index.qtpl:58 +} + +//line template/index.qtpl:58 +func Index() string { +//line template/index.qtpl:58 + qb422016 := qt422016.AcquireByteBuffer() +//line template/index.qtpl:58 + WriteIndex(qb422016) +//line template/index.qtpl:58 + qs422016 := string(qb422016.B) +//line template/index.qtpl:58 + qt422016.ReleaseByteBuffer(qb422016) +//line template/index.qtpl:58 + return qs422016 +//line template/index.qtpl:58 +} diff --git a/template/layout.qtpl.go b/template/layout.qtpl.go new file mode 100644 index 0000000..dc5e5d8 --- /dev/null +++ b/template/layout.qtpl.go @@ -0,0 +1,104 @@ +// Code generated by qtc from "layout.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +// The main layout function. + +//line template/layout.qtpl:2 +package template + +//line template/layout.qtpl:2 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line template/layout.qtpl:2 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line template/layout.qtpl:2 +func streamlayout(qw422016 *qt422016.Writer, css, scripts, title, contents, bodyscripts string) { +//line template/layout.qtpl:2 + qw422016.N().S(` + + `) +//line template/layout.qtpl:4 + qw422016.N().S(``) +//line template/layout.qtpl:10 + if len(css) == 0 { +//line template/layout.qtpl:10 + qw422016.N().S(``) +//line template/layout.qtpl:23 + } else { +//line template/layout.qtpl:24 + qw422016.N().S(css) +//line template/layout.qtpl:25 + } +//line template/layout.qtpl:27 + if len(scripts) != 0 { +//line template/layout.qtpl:28 + qw422016.N().S(scripts) +//line template/layout.qtpl:29 + } +//line template/layout.qtpl:31 + if len(title) == 0 { +//line template/layout.qtpl:31 + qw422016.N().S(`Burning Rubber Paste`) +//line template/layout.qtpl:33 + } else { +//line template/layout.qtpl:34 + qw422016.N().S(title) +//line template/layout.qtpl:35 + } +//line template/layout.qtpl:35 + qw422016.N().S(`
`) +//line template/layout.qtpl:39 + if len(contents) != 0 { +//line template/layout.qtpl:40 + qw422016.N().S(contents) +//line template/layout.qtpl:41 + } +//line template/layout.qtpl:41 + qw422016.N().S(`
`) +//line template/layout.qtpl:43 + if len(bodyscripts) != 0 { +//line template/layout.qtpl:44 + qw422016.N().S(bodyscripts) +//line template/layout.qtpl:45 + } +//line template/layout.qtpl:45 + qw422016.N().S(``) +//line template/layout.qtpl:48 + qw422016.N().S(` +`) +//line template/layout.qtpl:49 +} + +//line template/layout.qtpl:49 +func writelayout(qq422016 qtio422016.Writer, css, scripts, title, contents, bodyscripts string) { +//line template/layout.qtpl:49 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/layout.qtpl:49 + streamlayout(qw422016, css, scripts, title, contents, bodyscripts) +//line template/layout.qtpl:49 + qt422016.ReleaseWriter(qw422016) +//line template/layout.qtpl:49 +} + +//line template/layout.qtpl:49 +func layout(css, scripts, title, contents, bodyscripts string) string { +//line template/layout.qtpl:49 + qb422016 := qt422016.AcquireByteBuffer() +//line template/layout.qtpl:49 + writelayout(qb422016, css, scripts, title, contents, bodyscripts) +//line template/layout.qtpl:49 + qs422016 := string(qb422016.B) +//line template/layout.qtpl:49 + qt422016.ReleaseByteBuffer(qb422016) +//line template/layout.qtpl:49 + return qs422016 +//line template/layout.qtpl:49 +} -- cgit v1.2.3