Documentation ¶
Index ¶
- Constants
- Variables
- func Add(name string, creator Creator)
- func GetTransformerOptions() map[string][]Option
- func GetTransformerUsages() KeyValueSlice
- func SetError(errNum int, currentErr error, errType int, key string) (int, error)
- func SetStatsInfo(err error, stats StatsInfo, errNum, dataLen int64, transformType string) (StatsInfo, error)
- type Creator
- type Initializer
- type ServerTansformer
- type StatsTransformer
- type Transformer
Constants ¶
View Source
const ( KeyType = "type" TransformAt = "transform_at" )
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 ( General = iota GetErr SetErr NotExistErr = "transform key %v not exist in data" TypeErr = "value of %v is not the type of map[string]interface{}" )
Variables ¶
View Source
var ( KeyStage = Option{ KeyName: "stage", Element: Radio, ChooseOnly: true, ChooseOptions: []interface{}{StageAfterParser, StageBeforeParser}, Default: StageAfterParser, DefaultNoUse: false, Description: "transform运行的阶段(parser前还是parser后)(stage)", ToolTip: "transform在parser前或在parser后进行运行", Type: TransformTypeString, Advance: true, } KeyFieldName = Option{ KeyName: "key", ChooseOnly: false, Default: "", Required: true, Placeholder: "my_field_keyname", DefaultNoUse: true, Description: "要进行Transform变化的键(key)", ToolTip: "对该字段的值进行transform变换", Type: TransformTypeString, } KeyFieldNew = Option{ KeyName: "new", ChooseOnly: false, Default: "", Placeholder: "new_field_keyname", DefaultNoUse: false, Description: "新的字段名(new)", ToolTip: "生成的字段名称,不改变原有的字段", Type: TransformTypeString, } KeyFieldNewRequired = Option{ KeyName: "new", ChooseOnly: false, Default: "", Required: true, Placeholder: "new_field_keyname", DefaultNoUse: false, Description: "新的字段名(new)", ToolTip: "生成的字段名称,不改变原有的字段", 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)", Advance: true, CheckRegex: "*", Type: TransformTypeLong, ToolTip: "如果key中带有时区信息,则以该时区作为offset的基础时区,否则以UTC时区为基础时区", } )
View Source
var Transformers = map[string]Creator{}
Functions ¶
func GetTransformerOptions ¶
func GetTransformerOptions() map[string][]Option
func GetTransformerUsages ¶
func GetTransformerUsages() KeyValueSlice
Types ¶
type Creator ¶
type Creator func() Transformer
type ServerTansformer ¶
type ServerTansformer interface {
ServerConfig() map[string]interface{}
}
type StatsTransformer ¶
type StatsTransformer interface { // ReadData 用于读取一条数据以及数据的实际读取字节 SetStats(string) StatsInfo }
DataReader 代表了一个可直接读取内存数据结构的读取器
Click to show internal directories.
Click to hide internal directories.