config.go
889 字节
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
package config
import (
"time"
"github.com/tal-tech/go-queue/kq"
)
type (
Condition struct {
Key string
Value string
Type string `json:",default=match,options=match|contains"`
Op string `json:",default=and,options=and|or"`
}
ElasticSearchConf struct {
Hosts []string
DailyIndexPrefix string
TimeZone string `json:",optional"`
MaxChunkBytes int `json:",default=1048576"`
Compress bool `json:",default=false"`
}
Filter struct {
Action string `json:",options=drop|remove_field"`
Conditions []Condition `json:",optional"`
Fields []string `json:",optional"`
}
Processor struct {
Input struct {
Kafka kq.KqConf
}
Filters []Filter
Output struct {
ElasticSearch ElasticSearchConf
}
}
Config struct {
Processors []Processor
GracePeriod time.Duration `json:",default=10s"`
}
)