qiniu / logkit
Showing 1 of 4 files from the diff.

@@ -25,12 +25,13 @@
Loading
25 25
var _ sender.SkipDeepCopySender = &Sender{}
26 26
27 27
type Sender struct {
28 -
	url      string
29 -
	gZip     bool
30 -
	csvHead  bool
31 -
	protocol string
32 -
	csvSplit string
33 -
	template string
28 +
	url        string
29 +
	gZip       bool
30 +
	csvHead    bool
31 +
	escapeHtml bool
32 +
	protocol   string
33 +
	csvSplit   string
34 +
	template   string
34 35
35 36
	client         *http.Client
36 37
	templateRender *fasttemplate.Template
@@ -57,6 +58,7 @@
Loading
57 58
	csvHead, _ := c.GetBoolOr(KeyHttpSenderCsvHead, true)
58 59
	csvSplit, _ := c.GetStringOr(KeyHttpSenderCsvSplit, "\t")
59 60
	protocol, _ := c.GetStringOr(KeyHttpSenderProtocol, SendProtocolJson)
61 +
	escapeHtml, _ := c.GetBoolOr(KeyHttpEscapeHtml, true)
60 62
	runnerName, _ := c.GetStringOr(KeyRunnerName, UnderfinedRunnerName)
61 63
	timeout, _ := c.GetStringOr(KeyHttpTimeout, "30s")
62 64
	dur, err := time.ParseDuration(timeout)
@@ -87,6 +89,7 @@
Loading
87 89
		csvSplit:       csvSplit,
88 90
		runnerName:     runnerName,
89 91
		templateRender: templateRender,
92 +
		escapeHtml:     escapeHtml,
90 93
		client:         &http.Client{Timeout: dur},
91 94
	}
92 95
	return httpSender, nil
@@ -129,7 +132,15 @@
Loading
129 132
	if h.template != "" && h.templateRender != nil {
130 133
		return h.templateRender.ExecuteString(data), nil
131 134
	} else {
132 -
		db, err := jsoniter.Marshal(data)
135 +
		var (
136 +
			db  []byte
137 +
			err error
138 +
		)
139 +
		if !h.escapeHtml {
140 +
			db, err = jsoniter.Config{EscapeHTML: false}.Froze().Marshal(data)
141 +
		} else {
142 +
			db, err = jsoniter.Marshal(data)
143 +
		}
133 144
		if err != nil {
134 145
			return "", err
135 146
		}
Files Coverage
conf 97.67%
mgr 66.28%
parser 86.87%
queue 74.13%
rateio 95.74%
reader 47.80%
router 54.13%
samples 100.00%
sender 45.15%
transforms 55.85%
utils 57.20%
audit/audit.go 73.63%
cleaner/cleaner.go 58.82%
cli/upgrade.go 47.56%
logkit.go 35.20%
self/logrunner.go 53.88%
times/times.go 91.30%
Project Totals (138 files) 56.90%
3946.1
TRAVIS_OS_NAME=linux
1.12.9=.12.9

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