Documentation ¶
Index ¶
Constants ¶
View Source
const ( TransformTypeString = "string" TransformTypeLong = "long" TransformTypeFloat = "float" )
View Source
const ( StageBeforeParser = "before_parser" StageAfterParser = "after_parser" )
View Source
const (
KeyType = "type"
)
Variables ¶
View Source
var ( KeyStage = utils.Option{ KeyName: "stage", ChooseOnly: true, ChooseOptions: []string{StageAfterParser, StageBeforeParser}, Default: StageAfterParser, DefaultNoUse: false, Description: "transform运行的阶段(parser前还是parser后)(stage)", Type: TransformTypeString, } KeyStageAfterOnly = utils.Option{ KeyName: "stage", ChooseOnly: true, ChooseOptions: []string{StageAfterParser}, Default: StageAfterParser, DefaultNoUse: false, Description: "transform运行的阶段(stage)", Type: TransformTypeString, } KeyFieldName = utils.Option{ KeyName: "key", ChooseOnly: false, Default: "my_field_keyname", DefaultNoUse: true, Description: "要进行Transform变化的键(key)", Type: TransformTypeString, } )
View Source
var Transformers = map[string]Creator{}
Functions ¶
Types ¶
type Creator ¶
type Creator func() Transformer
type Transformer ¶
type Transformer interface { Description() string SampleConfig() string ConfigOptions() []utils.Option Type() string Transform([]sender.Data) ([]sender.Data, error) RawTransform([]string) ([]string, error) Stage() string Stats() utils.StatsInfo }
Transformer plugin做数据变换的接口 注意: transform的规则是,出错要把数据原样返回
Click to show internal directories.
Click to hide internal directories.