MCPcopy
hub / github.com/davyxu/tabtoy / dataProcessor

Function dataProcessor

v2/dataproc.go:67–89  ·  view source on GitHub ↗
(gc model.GlobalChecker, fd *model.FieldDescriptor, raw string, node *model.Node)

Source from the content-addressed store, hash-verified

65}
66
67func dataProcessor(gc model.GlobalChecker, fd *model.FieldDescriptor, raw string, node *model.Node) bool {
68
69 // 单值
70 if cv, ok := filter.ConvertValue(fd, raw, gc.GlobalFileDesc(), node); !ok {
71 goto ConvertError
72
73 } else {
74
75 // 值重复检查
76 if fd.Meta.GetBool("RepeatCheck") && !gc.CheckValueRepeat(fd, cv) {
77 log.Errorf("%s, %s raw: '%s'", i18n.String(i18n.DataSheet_ValueRepeated), fd.String(), cv)
78 return false
79 }
80 }
81
82 return true
83
84ConvertError:
85
86 log.Errorf("%s, %s raw: '%s'", i18n.String(i18n.DataSheet_ValueConvertError), fd.String(), raw)
87
88 return false
89}

Callers 1

coloumnProcessorFunction · 0.85

Calls 5

ConvertValueFunction · 0.92
StringFunction · 0.92
GlobalFileDescMethod · 0.65
CheckValueRepeatMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected