app/vmalert: run make quicktemplate-gen from the root dir of the repository

This commit is contained in:
Aliaksandr Valialkin 2020-05-16 22:42:33 +03:00
parent 5fbab64b0f
commit b99d03a956

View File

@ -1,131 +1,131 @@
// Code generated by qtc from "alertmanager_request.qtpl". DO NOT EDIT. // Code generated by qtc from "alertmanager_request.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details. // See https://github.com/valyala/quicktemplate for details.
//line notifier/alertmanager_request.qtpl:1 //line app/vmalert/notifier/alertmanager_request.qtpl:1
package notifier package notifier
//line notifier/alertmanager_request.qtpl:1 //line app/vmalert/notifier/alertmanager_request.qtpl:1
import ( import (
"strconv" "strconv"
"time" "time"
) )
//line notifier/alertmanager_request.qtpl:7 //line app/vmalert/notifier/alertmanager_request.qtpl:7
import ( import (
qtio422016 "io" qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate" qt422016 "github.com/valyala/quicktemplate"
) )
//line notifier/alertmanager_request.qtpl:7 //line app/vmalert/notifier/alertmanager_request.qtpl:7
var ( var (
_ = qtio422016.Copy _ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer _ = qt422016.AcquireByteBuffer
) )
//line notifier/alertmanager_request.qtpl:7 //line app/vmalert/notifier/alertmanager_request.qtpl:7
func streamamRequest(qw422016 *qt422016.Writer, alerts []Alert, generatorURL func(string, string) string) { func streamamRequest(qw422016 *qt422016.Writer, alerts []Alert, generatorURL func(string, string) string) {
//line notifier/alertmanager_request.qtpl:7 //line app/vmalert/notifier/alertmanager_request.qtpl:7
qw422016.N().S(`[`) qw422016.N().S(`[`)
//line notifier/alertmanager_request.qtpl:9 //line app/vmalert/notifier/alertmanager_request.qtpl:9
for i, alert := range alerts { for i, alert := range alerts {
//line notifier/alertmanager_request.qtpl:9 //line app/vmalert/notifier/alertmanager_request.qtpl:9
qw422016.N().S(`{"startsAt":`) qw422016.N().S(`{"startsAt":`)
//line notifier/alertmanager_request.qtpl:11 //line app/vmalert/notifier/alertmanager_request.qtpl:11
qw422016.N().Q(alert.Start.Format(time.RFC3339Nano)) qw422016.N().Q(alert.Start.Format(time.RFC3339Nano))
//line notifier/alertmanager_request.qtpl:11 //line app/vmalert/notifier/alertmanager_request.qtpl:11
qw422016.N().S(`,"generatorURL":`) qw422016.N().S(`,"generatorURL":`)
//line notifier/alertmanager_request.qtpl:12 //line app/vmalert/notifier/alertmanager_request.qtpl:12
qw422016.N().Q(generatorURL(strconv.FormatUint(alert.GroupID, 10), strconv.FormatUint(alert.ID, 10))) qw422016.N().Q(generatorURL(strconv.FormatUint(alert.GroupID, 10), strconv.FormatUint(alert.ID, 10)))
//line notifier/alertmanager_request.qtpl:12 //line app/vmalert/notifier/alertmanager_request.qtpl:12
qw422016.N().S(`,`) qw422016.N().S(`,`)
//line notifier/alertmanager_request.qtpl:13 //line app/vmalert/notifier/alertmanager_request.qtpl:13
if !alert.End.IsZero() { if !alert.End.IsZero() {
//line notifier/alertmanager_request.qtpl:13 //line app/vmalert/notifier/alertmanager_request.qtpl:13
qw422016.N().S(`"endsAt":`) qw422016.N().S(`"endsAt":`)
//line notifier/alertmanager_request.qtpl:14 //line app/vmalert/notifier/alertmanager_request.qtpl:14
qw422016.N().Q(alert.End.Format(time.RFC3339Nano)) qw422016.N().Q(alert.End.Format(time.RFC3339Nano))
//line notifier/alertmanager_request.qtpl:14 //line app/vmalert/notifier/alertmanager_request.qtpl:14
qw422016.N().S(`,`) qw422016.N().S(`,`)
//line notifier/alertmanager_request.qtpl:15 //line app/vmalert/notifier/alertmanager_request.qtpl:15
} }
//line notifier/alertmanager_request.qtpl:15 //line app/vmalert/notifier/alertmanager_request.qtpl:15
qw422016.N().S(`"labels": {"alertname":`) qw422016.N().S(`"labels": {"alertname":`)
//line notifier/alertmanager_request.qtpl:17 //line app/vmalert/notifier/alertmanager_request.qtpl:17
qw422016.N().Q(alert.Name) qw422016.N().Q(alert.Name)
//line notifier/alertmanager_request.qtpl:18 //line app/vmalert/notifier/alertmanager_request.qtpl:18
for k, v := range alert.Labels { for k, v := range alert.Labels {
//line notifier/alertmanager_request.qtpl:18 //line app/vmalert/notifier/alertmanager_request.qtpl:18
qw422016.N().S(`,`) qw422016.N().S(`,`)
//line notifier/alertmanager_request.qtpl:19 //line app/vmalert/notifier/alertmanager_request.qtpl:19
qw422016.N().Q(k) qw422016.N().Q(k)
//line notifier/alertmanager_request.qtpl:19 //line app/vmalert/notifier/alertmanager_request.qtpl:19
qw422016.N().S(`:`) qw422016.N().S(`:`)
//line notifier/alertmanager_request.qtpl:19 //line app/vmalert/notifier/alertmanager_request.qtpl:19
qw422016.N().Q(v) qw422016.N().Q(v)
//line notifier/alertmanager_request.qtpl:20 //line app/vmalert/notifier/alertmanager_request.qtpl:20
} }
//line notifier/alertmanager_request.qtpl:20 //line app/vmalert/notifier/alertmanager_request.qtpl:20
qw422016.N().S(`},"annotations": {`) qw422016.N().S(`},"annotations": {`)
//line notifier/alertmanager_request.qtpl:23 //line app/vmalert/notifier/alertmanager_request.qtpl:23
c := len(alert.Annotations) c := len(alert.Annotations)
//line notifier/alertmanager_request.qtpl:24 //line app/vmalert/notifier/alertmanager_request.qtpl:24
for k, v := range alert.Annotations { for k, v := range alert.Annotations {
//line notifier/alertmanager_request.qtpl:25 //line app/vmalert/notifier/alertmanager_request.qtpl:25
c = c - 1 c = c - 1
//line notifier/alertmanager_request.qtpl:26 //line app/vmalert/notifier/alertmanager_request.qtpl:26
qw422016.N().Q(k) qw422016.N().Q(k)
//line notifier/alertmanager_request.qtpl:26 //line app/vmalert/notifier/alertmanager_request.qtpl:26
qw422016.N().S(`:`) qw422016.N().S(`:`)
//line notifier/alertmanager_request.qtpl:26 //line app/vmalert/notifier/alertmanager_request.qtpl:26
qw422016.N().Q(v) qw422016.N().Q(v)
//line notifier/alertmanager_request.qtpl:26 //line app/vmalert/notifier/alertmanager_request.qtpl:26
if c > 0 { if c > 0 {
//line notifier/alertmanager_request.qtpl:26 //line app/vmalert/notifier/alertmanager_request.qtpl:26
qw422016.N().S(`,`) qw422016.N().S(`,`)
//line notifier/alertmanager_request.qtpl:26 //line app/vmalert/notifier/alertmanager_request.qtpl:26
} }
//line notifier/alertmanager_request.qtpl:27 //line app/vmalert/notifier/alertmanager_request.qtpl:27
} }
//line notifier/alertmanager_request.qtpl:27 //line app/vmalert/notifier/alertmanager_request.qtpl:27
qw422016.N().S(`}}`) qw422016.N().S(`}}`)
//line notifier/alertmanager_request.qtpl:30 //line app/vmalert/notifier/alertmanager_request.qtpl:30
if i != len(alerts)-1 { if i != len(alerts)-1 {
//line notifier/alertmanager_request.qtpl:30 //line app/vmalert/notifier/alertmanager_request.qtpl:30
qw422016.N().S(`,`) qw422016.N().S(`,`)
//line notifier/alertmanager_request.qtpl:30 //line app/vmalert/notifier/alertmanager_request.qtpl:30
} }
//line notifier/alertmanager_request.qtpl:31 //line app/vmalert/notifier/alertmanager_request.qtpl:31
} }
//line notifier/alertmanager_request.qtpl:31 //line app/vmalert/notifier/alertmanager_request.qtpl:31
qw422016.N().S(`]`) qw422016.N().S(`]`)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
} }
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
func writeamRequest(qq422016 qtio422016.Writer, alerts []Alert, generatorURL func(string, string) string) { func writeamRequest(qq422016 qtio422016.Writer, alerts []Alert, generatorURL func(string, string) string) {
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
streamamRequest(qw422016, alerts, generatorURL) streamamRequest(qw422016, alerts, generatorURL)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
} }
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
func amRequest(alerts []Alert, generatorURL func(string, string) string) string { func amRequest(alerts []Alert, generatorURL func(string, string) string) string {
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
writeamRequest(qb422016, alerts, generatorURL) writeamRequest(qb422016, alerts, generatorURL)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
return qs422016 return qs422016
//line notifier/alertmanager_request.qtpl:33 //line app/vmalert/notifier/alertmanager_request.qtpl:33
} }