Documentation ¶
Index ¶
Constants ¶
View Source
const ( TransformTypeString = "string" TransformTypeLong = "long" TransformTypeFloat = "float" TransformTypeBoolean = "bool" TransformTypeByte = "[]byte" )
View Source
const ( StageBeforeParser = "before_parser" StageAfterParser = "after_parser" )
View Source
const (
KeyType = "type"
)
Variables ¶
View Source
var ( KeyStage = Option{ KeyName: "stage", ChooseOnly: true, ChooseOptions: []interface{}{StageAfterParser, StageBeforeParser}, Default: StageAfterParser, DefaultNoUse: false, Description: "transform运行的阶段(parser前还是parser后)(stage)", Type: TransformTypeString, } KeyFieldName = Option{ KeyName: "key", ChooseOnly: false, Default: "", Required: true, Placeholder: "my_field_keyname", DefaultNoUse: true, Description: "要进行Transform变化的键(key)", Type: TransformTypeString, } KeyFieldNew = Option{ KeyName: "new", ChooseOnly: false, Default: "", Required: false, Placeholder: "new_field_keyname", DefaultNoUse: false, Description: "新的字段名", Type: TransformTypeString, } KeyFieldNewRequired = Option{ KeyName: "new", ChooseOnly: false, Default: "", Required: true, Placeholder: "new_field_keyname", DefaultNoUse: false, Description: "解析后数据的字段名", Type: TransformTypeString, } KeyTimezoneoffset = Option{ KeyName: "offset", ChooseOnly: true, ChooseOptions: []interface{}{0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12}, Default: 0, DefaultNoUse: false, Description: "时区偏移量(offset)", CheckRegex: "*", Type: TransformTypeLong, } )
View Source
var Transformers = map[string]Creator{}
Functions ¶
func GetTransformerOptions ¶ added in v1.4.3
func GetTransformerOptions() map[string][]Option
func GetTransformerUsages ¶ added in v1.4.3
func GetTransformerUsages() []KeyValue
Types ¶
type Creator ¶
type Creator func() Transformer
type Initialize ¶ added in v1.4.1
type Initialize interface {
Init() error
}
transformer初始化方法接口,err不为空表示初始化失败
Click to show internal directories.
Click to hide internal directories.