summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/pkg/matcher/doc.go
blob: 33b06988d63cfdb79609a4508e5cff59a815d0ed (plain)
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
// SPDX-License-Identifier: GPL-3.0-or-later

/*
Package matcher implements vary formats of string matcher.

Supported Format

	string
	glob
	regexp
	simple patterns

The string matcher reports whether the given value equals to the string ( use == ).

The glob matcher reports whether the given value matches the wildcard pattern.
The pattern syntax is:

	pattern:
	    { term }
	term:
	    '*'         matches any sequence of characters
	    '?'         matches any single character
	    '[' [ '^' ] { character-range } ']'
	    character class (must be non-empty)
	    c           matches character c (c != '*', '?', '\\', '[')
	    '\\' c      matches character c

	character-range:
	    c           matches character c (c != '\\', '-', ']')
	    '\\' c      matches character c
	    lo '-' hi   matches character c for lo <= c <= hi

The regexp matcher reports whether the given value matches the RegExp pattern ( use regexp.Match ).
The RegExp syntax is described at https://golang.org/pkg/regexp/syntax/.

The simple patterns matcher reports whether the given value matches the simple patterns.
The simple patterns is a custom format used in netdata,
it's syntax is described at https://docs.netdata.cloud/libnetdata/simple_pattern/.
*/
package matcher