@@ -12,8 +12,8 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"net/url"
16 +
	"strings"
17 17
18 18
	"github.com/xuri/aurora/beanstalk"
19 19
)
@@ -22,7 +22,7 @@
Loading
22 22
// server and tube conf.
23 23
func currentTubeJobsSummaryTable(server string, tube string) string {
24 24
	var err error
25 -
	var th, tr, td, template bytes.Buffer
25 +
	var th, tr, td, template strings.Builder
26 26
	var bstkConn *beanstalk.Conn
27 27
	if bstkConn, err = beanstalk.Dial("tcp", server); err != nil {
28 28
		for _, v := range selfConf.TubeFilters {
@@ -33,7 +33,7 @@
Loading
33 33
		if currentTubeStatisticCheck(server, tube) {
34 34
			th.WriteString(`<th> </th>`)
35 35
		}
36 -
		buf := bytes.Buffer{}
36 +
		buf := strings.Builder{}
37 37
		buf.WriteString(`<section id="summaryTable"><div class="row"><div class="col-sm-12"><table class="table table-striped table-hover"><thead><tr><th>name</th>`)
38 38
		buf.WriteString(th.String())
39 39
		buf.WriteString(`</tr></thead><tbody></tbody></table></div></div></section>`)

@@ -12,15 +12,15 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
17 16
	"net/url"
17 +
	"strings"
18 18
)
19 19
20 20
// tplStatistic renders a statistics overview graphs with Flot by given server
21 21
// and tube.
22 22
func tplStatistic(server string, tube string) string {
23 -
	buf := bytes.Buffer{}
23 +
	buf := strings.Builder{}
24 24
	buf.WriteString(TplHeaderBegin)
25 25
	buf.WriteString(`Statistics overview - `)
26 26
	buf.WriteString(tube)

@@ -12,8 +12,8 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
16 +
	"strings"
17 17
18 18
	"github.com/xuri/aurora/beanstalk"
19 19
)
@@ -21,7 +21,7 @@
Loading
21 21
// modalAddSample render add sample popup window.
22 22
func modalAddSample(server string, tube string) string {
23 23
	var err error
24 -
	var tubeList, buf bytes.Buffer
24 +
	var tubeList, buf strings.Builder
25 25
	var bstkConn *beanstalk.Conn
26 26
	if bstkConn, err = beanstalk.Dial("tcp", server); err != nil {
27 27
		return ``

@@ -12,10 +12,10 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"io"
17 16
	"net/http"
18 17
	"net/url"
18 +
	"strings"
19 19
)
20 20
21 21
// handlerMain handle request on router: /
@@ -91,7 +91,7 @@
Loading
91 91
92 92
// handleRedirect handle request with redirect response.
93 93
func handleRedirect(w http.ResponseWriter, r *http.Request, server string, tube string, action string, count string) {
94 -
	var link bytes.Buffer
94 +
	var link strings.Builder
95 95
	link.WriteString(`/tube?server=`)
96 96
	link.WriteString(server)
97 97
	link.WriteString(`&tube=`)

@@ -12,13 +12,13 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"strconv"
16 +
	"strings"
17 17
)
18 18
19 19
// tplSearchTube rander navigation search box for search content in jobs by given tube.
20 20
func tplSearchTube(server string, tube string, state string) string {
21 -
	buf := bytes.Buffer{}
21 +
	buf := strings.Builder{}
22 22
	buf.WriteString(`<form class="navbar-form navbar-right" style="margin-top:5px;margin-bottom:0px;" role="search" method="get"><input type="hidden" name="server" value="`)
23 23
	buf.WriteString(server)
24 24
	buf.WriteString(`"/><input type="hidden" name="tube" value="`)

@@ -12,7 +12,6 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"container/list"
17 16
	"io"
18 17
	"net/http"
@@ -172,7 +171,7 @@
Loading
172 171
173 172
// statisticWaitress return real-time statistics data by given server and tube.
174 173
func statisticWaitress(server string, tube string) string {
175 -
	var buf, b, s, l bytes.Buffer
174 +
	var buf, b, s, l strings.Builder
176 175
	b.WriteString(`{`)
177 176
	statisticsData.RLock()
178 177
	for _, field := range statisticsFields {

@@ -11,7 +11,7 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// tplMain render server list.
17 17
func tplMain(serverList string, currentServer string) string {
@@ -19,7 +19,7 @@
Loading
19 19
	if selfConf.IsDisabledJobDataHighlight != 1 {
20 20
		isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
21 21
	}
22 -
	buf := bytes.Buffer{}
22 +
	buf := strings.Builder{}
23 23
	buf.WriteString(TplHeaderBegin)
24 24
	buf.WriteString(`All servers -`)
25 25
	buf.WriteString(TplHeaderEnd)

@@ -34,7 +34,7 @@
Loading
34 34
35 35
// readConf read external config file when program startup.
36 36
func readConf() error {
37 -
	buf := new(bytes.Buffer)
37 +
	buf := new(strings.Builder)
38 38
	if _, err := os.Stat(ConfigFile); os.IsNotExist(err) {
39 39
		err := ioutil.WriteFile(ConfigFile, []byte(ConfigFileTemplate), 0644)
40 40
		if err != nil {

@@ -11,7 +11,7 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// tplServer render tube stats table by given server.
17 17
func tplServer(content string, server string) string {
@@ -19,7 +19,7 @@
Loading
19 19
	if selfConf.IsDisabledJobDataHighlight != 1 {
20 20
		isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
21 21
	}
22 -
	buf := bytes.Buffer{}
22 +
	buf := strings.Builder{}
23 23
	buf.WriteString(TplHeaderBegin)
24 24
	buf.WriteString(server)
25 25
	buf.WriteString(` -`)

@@ -319,7 +319,7 @@
Loading
319 319
	if len(sampleJobs.Jobs) == 0 {
320 320
		return `<div class="clearfix"><div class="pull-left">There are no saved jobs.</div><div class="pull-right"><a href="?action=newSample" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-plus"></i> Add job to samples</a></div></div>`
321 321
	}
322 -
	var tr, td, serverList, buf bytes.Buffer
322 +
	var tr, td, serverList, buf strings.Builder
323 323
	for _, j := range sampleJobs.Jobs {
324 324
		for _, v := range j.Tubes {
325 325
			for _, s := range selfConf.Servers {

@@ -12,16 +12,16 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
17 16
	"net/url"
18 17
	"strconv"
18 +
	"strings"
19 19
)
20 20
21 21
// currentTubeSearchResults constructs a search result table by given server,
22 22
// tube, search result limit and search content.
23 23
func currentTubeSearchResults(server string, tube string, limit string, searchStr string, result []SearchResult) string {
24 -
	var buf, tr bytes.Buffer
24 +
	var buf, tr strings.Builder
25 25
	if len(result) == 0 {
26 26
		buf.WriteString(`<br/>No results found for <b>`)
27 27
		buf.WriteString(html.EscapeString(searchStr))

@@ -11,7 +11,7 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// tplSampleJobsManage render sample job manage list page.
17 17
func tplSampleJobsManage(sampleList string, currentServer string) string {
@@ -19,7 +19,7 @@
Loading
19 19
	if selfConf.IsDisabledJobDataHighlight != 1 {
20 20
		isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
21 21
	}
22 -
	buf := bytes.Buffer{}
22 +
	buf := strings.Builder{}
23 23
	buf.WriteString(TplHeaderBegin)
24 24
	buf.WriteString(`Manage samples -`)
25 25
	buf.WriteString(TplHeaderEnd)

@@ -12,10 +12,10 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
17 16
	"net/url"
18 17
	"strconv"
18 +
	"strings"
19 19
20 20
	"github.com/xuri/aurora/beanstalk"
21 21
)
@@ -24,7 +24,7 @@
Loading
24 24
// currentTubeJobsShowcaseSections function and get that return value based on
25 25
// the given server and tube config.
26 26
func currentTubeJobsShowcase(server string, tube string) string {
27 -
	var buf bytes.Buffer
27 +
	var buf strings.Builder
28 28
	buf.WriteString(`<section class="jobsShowcase">`)
29 29
	buf.WriteString(currentTubeJobsShowcaseSections(server, tube))
30 30
	buf.WriteString(`</section>`)
@@ -36,7 +36,7 @@
Loading
36 36
func currentTubeJobsShowcaseSections(server string, tube string) string {
37 37
	stats := []string{"ready", "delayed", "buried"}
38 38
	var err error
39 -
	var buf, s, j, b, m, r bytes.Buffer
39 +
	var buf, s, j, b, m, r strings.Builder
40 40
	var bstkConn *beanstalk.Conn
41 41
	if bstkConn, err = beanstalk.Dial("tcp", server); err != nil {
42 42
		return `<hr><div class="pull-left"><h3>Next job in "ready" state</h3></div><div class="clearfix"></div><i>empty</i><hr><div class="pull-left"><h3>Next job in "delayed" state</h3></div><div class="clearfix"></div><i>empty</i><hr><div class="pull-left"><h3>Next job in "buried" state</h3></div><div class="clearfix"></div><i>empty</i>`

@@ -11,14 +11,14 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// currentTubeJobs call currentTubeJobsSummaryTable, currentTubeJobsActionsRow
17 17
// and currentTubeJobsShowcase functions by given server and tube config, and
18 18
// merge these functions return value.
19 19
func currentTubeJobs(server string, tube string) string {
20 20
	var table = currentTubeJobsSummaryTable(server, tube)
21 -
	buf := bytes.Buffer{}
21 +
	buf := strings.Builder{}
22 22
	if table == `` {
23 23
		buf.WriteString(`Tube "`)
24 24
		buf.WriteString(tube)

@@ -12,10 +12,10 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
17 16
	"sort"
18 17
	"strconv"
18 +
	"strings"
19 19
20 20
	"github.com/xuri/aurora/beanstalk"
21 21
)
@@ -23,7 +23,7 @@
Loading
23 23
// tplSampleJobEdit render a sample job edit form.
24 24
func tplSampleJobEdit(key string, alert string) string {
25 25
	var err error
26 -
	var buf, action, title, name, savedTo, saveTo, data, ST, tubeList, TTR bytes.Buffer
26 +
	var buf, action, title, name, savedTo, saveTo, data, ST, tubeList, TTR strings.Builder
27 27
	if key == "" {
28 28
		action.WriteString(`?action=actionNewSample`)
29 29
		title.WriteString(`<h4 class="text-info">New sample job</h4>`)

@@ -12,8 +12,8 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
16 +
	"strings"
17 17
18 18
	"github.com/xuri/aurora/beanstalk"
19 19
)
@@ -21,7 +21,7 @@
Loading
21 21
// modalClearTubes render modal popup for delete job in tubes.
22 22
func modalClearTubes(server string) string {
23 23
	var err error
24 -
	var buf, tubeList bytes.Buffer
24 +
	var buf, tubeList strings.Builder
25 25
	var bstkConn *beanstalk.Conn
26 26
	if bstkConn, err = beanstalk.Dial("tcp", server); err != nil {
27 27
		return ``

@@ -12,10 +12,10 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"html"
17 16
	"net/url"
18 17
	"strconv"
18 +
	"strings"
19 19
20 20
	"github.com/xuri/aurora/beanstalk"
21 21
)
@@ -25,7 +25,7 @@
Loading
25 25
func currentTubeJobsActionsRow(server string, tube string) string {
26 26
	var err error
27 27
	var bstkConn *beanstalk.Conn
28 -
	var buf, pauseTimeLeft bytes.Buffer
28 +
	var buf, pauseTimeLeft strings.Builder
29 29
	var pause = strconv.Itoa(selfConf.TubePauseSeconds)
30 30
	if pause == "-1" {
31 31
		pause = "3600"
@@ -75,7 +75,7 @@
Loading
75 75
// currentTubeJobsActionsRowSample render a dropdown sample list by given server
76 76
// and tube.
77 77
func currentTubeJobsActionsRowSample(server string, tube string) string {
78 -
	sample := bytes.Buffer{}
78 +
	sample := strings.Builder{}
79 79
	for _, v := range sampleJobs.Tubes {
80 80
		if v.Name != tube {
81 81
			continue

@@ -12,10 +12,10 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"net/url"
17 16
	"sort"
18 17
	"strconv"
18 +
	"strings"
19 19
20 20
	"github.com/xuri/aurora/beanstalk"
21 21
)
@@ -23,7 +23,7 @@
Loading
23 23
// getServerStatus render a server stats table.
24 24
func getServerStatus() string {
25 25
	var err error
26 -
	var buf, td, th bytes.Buffer
26 +
	var buf, td, th strings.Builder
27 27
	for _, addr := range selfConf.Servers {
28 28
		var bstkConn *beanstalk.Conn
29 29
		if bstkConn, err = beanstalk.Dial("tcp", addr); err != nil {
@@ -68,7 +68,7 @@
Loading
68 68
// getServerTubes render a tubes stats table by given server.
69 69
func getServerTubes(server string) string {
70 70
	var err error
71 -
	var buf, th, tr, td bytes.Buffer
71 +
	var buf, th, tr, td strings.Builder
72 72
	var bstkConn *beanstalk.Conn
73 73
	for _, v := range selfConf.TubeFilters {
74 74
		th.WriteString(`<th>`)
@@ -119,7 +119,7 @@
Loading
119 119
120 120
// dropDownServer render a navigation dropdown menu for server list.
121 121
func dropDownServer(currentServer string) string {
122 -
	var ul bytes.Buffer
122 +
	var ul strings.Builder
123 123
	if currentServer == "" {
124 124
		currentServer = `All servers`
125 125
	}
@@ -145,7 +145,7 @@
Loading
145 145
146 146
// dropDownTube render a navigation dropdown menu for tube list.
147 147
func dropDownTube(server string, currentTube string) string {
148 -
	var ul bytes.Buffer
148 +
	var ul strings.Builder
149 149
	if currentTube == "" {
150 150
		currentTube = `All tubes`
151 151
	}
@@ -184,7 +184,7 @@
Loading
184 184
185 185
// dropEditSettings render a navigation dropdown menu for set preference.
186 186
func dropEditSettings() string {
187 -
	var buf bytes.Buffer
187 +
	var buf strings.Builder
188 188
	var isDisabledJSONDecode, isDisabledJobDataHighlight, isEnabledBase64Decode string
189 189
	if selfConf.IsDisabledJSONDecode != 1 {
190 190
		isDisabledJSONDecode = `checked="checked"`

@@ -11,7 +11,7 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// tplTube render job stats page in tube by given server.
17 17
func tplTube(content string, server string, tube string) string {
@@ -19,7 +19,7 @@
Loading
19 19
	if selfConf.IsDisabledJobDataHighlight != 1 {
20 20
		isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
21 21
	}
22 -
	buf := bytes.Buffer{}
22 +
	buf := strings.Builder{}
23 23
	buf.WriteString(TplHeaderBegin)
24 24
	buf.WriteString(tube)
25 25
	buf.WriteString(` - `)

@@ -12,13 +12,13 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"strconv"
16 +
	"strings"
17 17
)
18 18
19 19
// modalAddJob render modal popup for add a job to tube.
20 20
func modalAddJob(tube string) string {
21 -
	buf := bytes.Buffer{}
21 +
	buf := strings.Builder{}
22 22
	buf.WriteString(`<div class="modal fade" id="modalAddJob" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Add new job</h4></div><div class="modal-body"><form class="form-horizontal"><fieldset><div class="alert alert-danger" id="tubeSaveAlert" style="display: none;"><button type="button" class="close" onclick="$('#tubeSaveAlert').fadeOut('fast');">×</button><strong>Error!</strong> Required fields are marked * </div><div class="form-group"><label class="control-label col-xs-3">*Tube name</label><div class="col-xs-9"><input class="form-control focused" id="tubeName" type="text" value="`)
23 23
	buf.WriteString(tube)
24 24
	buf.WriteString(`"></div></div><div class="form-group"><label class="control-label col-xs-3">*Data</label><div class="col-xs-9"><textarea id="tubeData" rows="3" class="form-control"></textarea></div></div><div class="form-group"><label class="control-label col-xs-3">Priority</label><div class="col-xs-9"><input class="form-control focused" id="tubePriority" type="number" value="`)

@@ -11,12 +11,12 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// tplServerFilterStatsGroups render server filter stats groups checkbox.
17 17
func tplServerFilterStatsGroups() []string {
18 18
	stats := []string{"", "", "", ""}
19 -
	buf := bytes.Buffer{}
19 +
	buf := strings.Builder{}
20 20
	statsGroupsFilter := [][]map[string]string{binlogStatsGroups, cmdStatsGroups, currentStatsGroups, otherStatsGroups}
21 21
	for k, statsGroups := range statsGroupsFilter {
22 22
		for _, statsGroup := range statsGroups {
@@ -44,7 +44,7 @@
Loading
44 44
45 45
// tplServerFilter render modal popup for select server tube stats column.
46 46
func tplServerFilter() string {
47 -
	filter := bytes.Buffer{}
47 +
	filter := strings.Builder{}
48 48
	stats := tplServerFilterStatsGroups()
49 49
	filter.WriteString(`<div id="filterServer" data-cookie="filter" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h3 id="filter-label" class="text-info">Filter columns</h3></div><div class="modal-body"><form class="form-group"><div class="tabbable"><ul class="nav nav-tabs"><li class="active"><a href="#binlog" data-toggle="tab">binlog</a></li><li><a href="#cmd" data-toggle="tab">cmd</a></li><li><a href="#current" data-toggle="tab">current</a></li><li><a href="#other" data-toggle="tab">other</a></li></ul><div class="tab-content"><div class="tab-pane active" id="binlog">`)
50 50
	filter.WriteString(stats[0])
@@ -60,7 +60,7 @@
Loading
60 60
61 61
// tplTubeFilter render a modal popup for select job stats of tube.
62 62
func tplTubeFilter() string {
63 -
	var buf, currents, others bytes.Buffer
63 +
	var buf, currents, others strings.Builder
64 64
	for k, current := range tubeStatFields {
65 65
		if k > 7 {
66 66
			continue

@@ -12,9 +12,9 @@
Loading
12 12
package main
13 13
14 14
import (
15 -
	"bytes"
16 15
	"sort"
17 16
	"strconv"
17 +
	"strings"
18 18
19 19
	"github.com/xuri/aurora/beanstalk"
20 20
)
@@ -22,7 +22,7 @@
Loading
22 22
// tplStatisticEdit provide method to render the statistics preference page.
23 23
func tplStatisticEdit(alert string) string {
24 24
	var err error
25 -
	var buf, savedTo, ST, tubeList bytes.Buffer
25 +
	var buf, savedTo, ST, tubeList strings.Builder
26 26
	frequency := selfConf.StatisticsFrequency
27 27
	if frequency < 1 {
28 28
		frequency = 300

@@ -11,11 +11,11 @@
Loading
11 11
12 12
package main
13 13
14 -
import "bytes"
14 +
import "strings"
15 15
16 16
// tplStatisticSetting statistic preferences page.
17 17
func tplStatisticSetting(content string) string {
18 -
	buf := bytes.Buffer{}
18 +
	buf := strings.Builder{}
19 19
	buf.WriteString(TplHeaderBegin)
20 20
	buf.WriteString(`Statistics preference -`)
21 21
	buf.WriteString(TplHeaderEnd)
Files Coverage
cookies.go 96.88%
currentTube.go 100.00%
currentTubeJobs.go 100.00%
currentTubeJobsActionsRow.go 97.06%
currentTubeJobsShowcase.go 94.55%
currentTubeJobsSummaryTable.go 90.48%
currentTubeSearchResults.go 100.00%
handlers.go 94.16%
lib.go 84.98%
main.go 18.37%
modalAddJob.go 100.00%
modalAddSample.go 100.00%
modalClearTubes.go 100.00%
sampleJobUtils.go 71.37%
statisticsUtils.go 80.92%
tplFilter.go 100.00%
tplMain.go 100.00%
tplNav.go 98.70%
tplSampleJobEdit.go 79.73%
tplSampleJobsManage.go 100.00%
tplSearchTube.go 100.00%
tplServer.go 100.00%
tplStatistic.go 100.00%
tplStatisticEdit.go 100.00%
tplStatisticSetting.go 100.00%
tplTube.go 100.00%
utils.go 75.52%
Project Totals (27 files) 86.97%
28.1
TRAVIS_GO_VERSION=1.10.x
TRAVIS_OS_NAME=linux
28.2
TRAVIS_GO_VERSION=1.10.x
TRAVIS_OS_NAME=linux
28.4
TRAVIS_GO_VERSION=1.11.x
TRAVIS_OS_NAME=linux
28.3
TRAVIS_GO_VERSION=1.11.x
TRAVIS_OS_NAME=linux
28.6
TRAVIS_GO_VERSION=1.12.x
TRAVIS_OS_NAME=linux
28.5
TRAVIS_GO_VERSION=1.12.x
TRAVIS_OS_NAME=linux
28.8
TRAVIS_GO_VERSION=1.13.x
TRAVIS_OS_NAME=linux
28.7
TRAVIS_GO_VERSION=1.13.x
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading