Skip to content

Commit 7204ee9

Browse files
committed
[PDR-17566][feat(config)]: 配置文案调整
1 parent b75db0e commit 7204ee9

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

reader/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var (
104104
KeyName: KeyEncoding,
105105
ChooseOnly: true,
106106
ChooseOptions: Encoding,
107-
Default: "UTF-8",
107+
Default: "自动",
108108
DefaultNoUse: false,
109109
Description: "编码方式(encoding)",
110110
Advance: true,
@@ -124,10 +124,10 @@ var (
124124
ChooseOnly: false,
125125
Default: "",
126126
DefaultNoUse: false,
127-
Description: "读取速度限制(readio_limit)",
127+
Description: "传输带宽限制(readio_limit)",
128128
CheckRegex: "\\d+",
129129
Advance: true,
130-
ToolTip: "读取文件的磁盘限速,填写正整数,单位为MB/s, 默认不限速",
130+
ToolTip: "对网络带宽传输速度进行限制,填写正整数,单位为MB/s, 默认不限速",
131131
}
132132
OptionDelimiter = Option{
133133
KeyName: KeyDelimiter,

reader/meta.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ func NewMetaWithConf(conf conf.MapConf) (meta *Meta, err error) {
195195
meta.extrainfo = make(map[string]string)
196196
}
197197
decoder, _ := conf.GetStringOr(KeyEncoding, "")
198+
if decoder == "自动" {
199+
decoder = "UTF-8"
200+
}
198201
if decoder != "" {
199202
meta.SetEncodingWay(strings.ToLower(decoder))
200203
}

reader/socket/socket.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
369369
}
370370
var decoder mahonia.Decoder
371371
encoding, _ := conf.GetStringOr(KeyEncoding, "")
372+
if encoding == "自动" {
373+
encoding = "UTF-8"
374+
}
372375
encoding = strings.ToUpper(encoding)
373376
if encoding != DefaultEncodingWay {
374377
decoder = mahonia.NewDecoder(encoding)

utils/models/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var (
109109
// matches a plain pattern name. ie, %{NUMBER}
110110
PatternOnlyRe = regexp.MustCompile(`%{(\w+)}`)
111111

112-
Encoding = []interface{}{"UTF-8", "UTF-16", "US-ASCII", "ISO-8859-1",
112+
Encoding = []interface{}{"自动", "UTF-8", "UTF-16", "US-ASCII", "ISO-8859-1",
113113
"GBK", "latin1", "GB18030", "EUC-JP", "UTF-16BE", "UTF-16LE", "Big5", "Shift_JIS",
114114
"ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7",
115115
"ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-11", "ISO-8859-13",

0 commit comments

Comments
 (0)