-
Notifications
You must be signed in to change notification settings - Fork 2
/
export_test.go
63 lines (48 loc) · 1.14 KB
/
export_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package snitch
import "github.com/xjewer/snitch/lib/config"
// line
func (l *Line) GetText() string {
return l.text
}
// metric
type Metric = metric
type KeyPath = keyPath
func GetVarName(v string) (int, error) {
return getVarName(v)
}
func MakeMetrics(keys []config.Key, prefix string) ([]*metric, error) {
return makeMetrics(keys, prefix)
}
func NewKeyPath(v string, m int, isVar bool) KeyPath {
return KeyPath{
val: v,
match: m,
isVar: isVar,
}
}
func NewMetric(keys []KeyPath, count, timing bool, td int, d string) *Metric {
return &metric{
keyPaths: keys,
count: count,
timing: timing,
timingData: td,
delimiter: d,
}
}
// parser
type Handler = handler
func GetElementAmount(l *Line, i int, sep string) (float32, error) {
return getElementAmount(l, i, sep)
}
func GetAmount(s string, sep string) (float32, error) {
return getAmount(s, sep)
}
func GetElementString(l *Line, i int, sep string, last bool) (string, error) {
return getElementString(l, i, sep, last)
}
func GetLastMatch(s string, sep string) string {
return getLastMatch(s, sep)
}
func SubstituteDots(s string) string {
return substituteDots(s)
}