Documentation ¶
Overview ¶
Copyright [2019] housepower
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright [2019] housepower
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func CsvGetFloat[T constraints.Float](c *CsvMetric, key string, nullable bool, max float64) (val interface{})
- func CsvGetInt[T constraints.Signed](c *CsvMetric, key string, nullable bool, min, max int64) (val interface{})
- func CsvGetUint[T constraints.Unsigned](c *CsvMetric, key string, nullable bool, max uint64) (val interface{})
- func FastjsonFloatArray[T constraints.Float](a []*fastjson.Value, max float64) (arr []T)
- func FastjsonGetFloat[T constraints.Float](c *FastjsonMetric, key string, nullable bool, max float64) (val interface{})
- func FastjsonGetInt[T constraints.Signed](c *FastjsonMetric, key string, nullable bool, min, max int64) (val interface{})
- func FastjsonGetUint[T constraints.Unsigned](c *FastjsonMetric, key string, nullable bool, max uint64) (val interface{})
- func FastjsonIntArray[T constraints.Signed](a []*fastjson.Value, min, max int64) (arr []T)
- func FastjsonUintArray[T constraints.Unsigned](a []*fastjson.Value, max uint64) (arr []T)
- func GjsonFloatArray[T constraints.Float](a []gjson.Result, max float64) (arr []T)
- func GjsonGetFloat[T constraints.Float](c *GjsonMetric, key string, nullable bool, max float64) (val interface{})
- func GjsonGetInt[T constraints.Signed](c *GjsonMetric, key string, nullable bool, min, max int64) (val interface{})
- func GjsonGetUint[T constraints.Unsigned](c *GjsonMetric, key string, nullable bool, max uint64) (val interface{})
- func GjsonIntArray[T constraints.Signed](a []gjson.Result, min, max int64) (arr []T)
- func GjsonUintArray[T constraints.Unsigned](a []gjson.Result, max uint64) (arr []T)
- func UnixFloat(sec, unit float64) (t time.Time)
- type CsvMetric
- func (c *CsvMetric) GetArray(key string, typ int) (val interface{})
- func (c *CsvMetric) GetBool(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetDateTime(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetDecimal(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetFloat32(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetFloat64(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetIPv4(key string, nullable bool) interface{}
- func (c *CsvMetric) GetIPv6(key string, nullable bool) interface{}
- func (c *CsvMetric) GetInt16(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetInt32(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetInt64(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetInt8(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetNewKeys(knownKeys, newKeys, warnKeys *sync.Map, white, black *regexp.Regexp, ...) bool
- func (c *CsvMetric) GetString(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetUUID(key string, nullable bool) interface{}
- func (c *CsvMetric) GetUint16(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetUint32(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetUint64(key string, nullable bool) (val interface{})
- func (c *CsvMetric) GetUint8(key string, nullable bool) (val interface{})
- type CsvParser
- type FastjsonMetric
- func (c *FastjsonMetric) GetArray(key string, typ int) (val interface{})
- func (c *FastjsonMetric) GetBool(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetDateTime(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetDecimal(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetFloat32(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetFloat64(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetIPv4(key string, nullable bool) interface{}
- func (c *FastjsonMetric) GetIPv6(key string, nullable bool) interface{}
- func (c *FastjsonMetric) GetInt16(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetInt32(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetInt64(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetInt8(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetNewKeys(knownKeys, newKeys, warnKeys *sync.Map, white, black *regexp.Regexp, ...) (foundNew bool)
- func (c *FastjsonMetric) GetString(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetUUID(key string, nullable bool) interface{}
- func (c *FastjsonMetric) GetUint16(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetUint32(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetUint64(key string, nullable bool) (val interface{})
- func (c *FastjsonMetric) GetUint8(key string, nullable bool) (val interface{})
- type FastjsonParser
- type GjsonMetric
- func (c *GjsonMetric) GetArray(key string, typ int) (val interface{})
- func (c *GjsonMetric) GetBool(key string, nullable bool) interface{}
- func (c *GjsonMetric) GetDateTime(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetDecimal(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetFloat32(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetFloat64(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetIPv4(key string, nullable bool) interface{}
- func (c *GjsonMetric) GetIPv6(key string, nullable bool) interface{}
- func (c *GjsonMetric) GetInt16(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetInt32(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetInt64(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetInt8(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetNewKeys(knownKeys, newKeys, warnKeys *sync.Map, white, black *regexp.Regexp, ...) (foundNew bool)
- func (c *GjsonMetric) GetString(key string, nullable bool) interface{}
- func (c *GjsonMetric) GetUUID(key string, nullable bool) interface{}
- func (c *GjsonMetric) GetUint16(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetUint32(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetUint64(key string, nullable bool) (val interface{})
- func (c *GjsonMetric) GetUint8(key string, nullable bool) (val interface{})
- type GjsonParser
- type Parser
- type Pool
- type ProtoDeserializer
- type ProtoMetric
- func (m *ProtoMetric) GetArray(key string, t int) interface{}
- func (m *ProtoMetric) GetBool(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetDateTime(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetDecimal(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetFloat32(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetFloat64(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetIPv4(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetIPv6(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetInt16(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetInt32(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetInt64(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetInt8(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetNewKeys(knownKeys, newKeys, warnKeys *sync.Map, white, black *regexp.Regexp, ...) bool
- func (m *ProtoMetric) GetString(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetUUID(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetUint16(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetUint32(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetUint64(key string, nullable bool) interface{}
- func (m *ProtoMetric) GetUint8(key string, nullable bool) interface{}
- type ProtoParser
Constants ¶
This section is empty.
Variables ¶
var ( Layouts = []string{ "2006-01-02T15:04:05Z07:00", "2006-01-02T15:04:05Z0700", "2006-01-02T15:04:05", "2006-01-02 15:04:05Z07:00", "2006-01-02 15:04:05Z0700", "2006-01-02 15:04:05", "Mon Jan _2 15:04:05 2006", "Mon Jan _2 15:04:05 MST 2006", "Mon Jan 02 15:04:05 -0700 2006", "02 Jan 06 15:04 MST", "02 Jan 06 15:04 -0700", "Monday, 02-Jan-06 15:04:05 MST", "Mon, 02 Jan 2006 15:04:05 MST", "Mon, 02 Jan 2006 15:04:05 -0700", "Mon Jan 02 15:04:05 MST 2006", "Mon 02 Jan 2006 03:04:05 PM MST", "Jan 02, 2006 15:04:05Z07:00", "Jan 02, 2006 15:04:05Z0700", "Jan 02, 2006 15:04:05", "02/Jan/2006 15:04:05 Z07:00", "02/Jan/2006 15:04:05 Z0700", "02/Jan/2006 15:04:05", "2006-01-02", "02/01/2006", "02/Jan/2006", "Jan 02, 2006", "Mon Jan 02, 2006", } Epoch = time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC) ErrParseDateTime = errors.Newf("value doesn't contain DateTime") )
Functions ¶
func CsvGetFloat ¶
func CsvGetFloat[T constraints.Float](c *CsvMetric, key string, nullable bool, max float64) (val interface{})
GetFloat returns the value as float
func CsvGetUint ¶
func FastjsonFloatArray ¶
func FastjsonFloatArray[T constraints.Float](a []*fastjson.Value, max float64) (arr []T)
func FastjsonGetFloat ¶
func FastjsonGetFloat[T constraints.Float](c *FastjsonMetric, key string, nullable bool, max float64) (val interface{})
func FastjsonGetInt ¶
func FastjsonGetInt[T constraints.Signed](c *FastjsonMetric, key string, nullable bool, min, max int64) (val interface{})
func FastjsonGetUint ¶
func FastjsonGetUint[T constraints.Unsigned](c *FastjsonMetric, key string, nullable bool, max uint64) (val interface{})
func FastjsonIntArray ¶
func FastjsonIntArray[T constraints.Signed](a []*fastjson.Value, min, max int64) (arr []T)
func FastjsonUintArray ¶
func FastjsonUintArray[T constraints.Unsigned](a []*fastjson.Value, max uint64) (arr []T)
func GjsonFloatArray ¶
func GjsonFloatArray[T constraints.Float](a []gjson.Result, max float64) (arr []T)
func GjsonGetFloat ¶
func GjsonGetFloat[T constraints.Float](c *GjsonMetric, key string, nullable bool, max float64) (val interface{})
func GjsonGetInt ¶
func GjsonGetInt[T constraints.Signed](c *GjsonMetric, key string, nullable bool, min, max int64) (val interface{})
func GjsonGetUint ¶
func GjsonGetUint[T constraints.Unsigned](c *GjsonMetric, key string, nullable bool, max uint64) (val interface{})
func GjsonIntArray ¶
func GjsonIntArray[T constraints.Signed](a []gjson.Result, min, max int64) (arr []T)
func GjsonUintArray ¶
func GjsonUintArray[T constraints.Unsigned](a []gjson.Result, max uint64) (arr []T)
Types ¶
type CsvMetric ¶
type CsvMetric struct {
// contains filtered or unexported fields
}
CsvMetic
func (*CsvMetric) GetDateTime ¶
func (*CsvMetric) GetDecimal ¶
GetDecimal returns the value as decimal
func (*CsvMetric) GetFloat32 ¶
func (*CsvMetric) GetFloat64 ¶
func (*CsvMetric) GetNewKeys ¶
type CsvParser ¶
type CsvParser struct {
// contains filtered or unexported fields
}
CsvParser implementation to parse input from a CSV format per RFC 4180
type FastjsonMetric ¶
type FastjsonMetric struct {
// contains filtered or unexported fields
}
func (*FastjsonMetric) GetArray ¶
func (c *FastjsonMetric) GetArray(key string, typ int) (val interface{})
func (*FastjsonMetric) GetBool ¶
func (c *FastjsonMetric) GetBool(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetDateTime ¶
func (c *FastjsonMetric) GetDateTime(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetDecimal ¶
func (c *FastjsonMetric) GetDecimal(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetFloat32 ¶
func (c *FastjsonMetric) GetFloat32(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetFloat64 ¶
func (c *FastjsonMetric) GetFloat64(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetIPv4 ¶ added in v0.4.0
func (c *FastjsonMetric) GetIPv4(key string, nullable bool) interface{}
func (*FastjsonMetric) GetIPv6 ¶ added in v0.4.0
func (c *FastjsonMetric) GetIPv6(key string, nullable bool) interface{}
func (*FastjsonMetric) GetInt16 ¶
func (c *FastjsonMetric) GetInt16(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetInt32 ¶
func (c *FastjsonMetric) GetInt32(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetInt64 ¶
func (c *FastjsonMetric) GetInt64(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetInt8 ¶
func (c *FastjsonMetric) GetInt8(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetNewKeys ¶
func (*FastjsonMetric) GetString ¶
func (c *FastjsonMetric) GetString(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetUUID ¶ added in v0.2.0
func (c *FastjsonMetric) GetUUID(key string, nullable bool) interface{}
func (*FastjsonMetric) GetUint16 ¶
func (c *FastjsonMetric) GetUint16(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetUint32 ¶
func (c *FastjsonMetric) GetUint32(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetUint64 ¶
func (c *FastjsonMetric) GetUint64(key string, nullable bool) (val interface{})
func (*FastjsonMetric) GetUint8 ¶
func (c *FastjsonMetric) GetUint8(key string, nullable bool) (val interface{})
type FastjsonParser ¶
type FastjsonParser struct {
// contains filtered or unexported fields
}
FastjsonParser, parser for get data in json format
type GjsonMetric ¶
type GjsonMetric struct {
// contains filtered or unexported fields
}
func (*GjsonMetric) GetArray ¶
func (c *GjsonMetric) GetArray(key string, typ int) (val interface{})
func (*GjsonMetric) GetBool ¶
func (c *GjsonMetric) GetBool(key string, nullable bool) interface{}
func (*GjsonMetric) GetDateTime ¶
func (c *GjsonMetric) GetDateTime(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetDecimal ¶
func (c *GjsonMetric) GetDecimal(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetFloat32 ¶
func (c *GjsonMetric) GetFloat32(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetFloat64 ¶
func (c *GjsonMetric) GetFloat64(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetIPv4 ¶ added in v0.4.0
func (c *GjsonMetric) GetIPv4(key string, nullable bool) interface{}
func (*GjsonMetric) GetIPv6 ¶ added in v0.4.0
func (c *GjsonMetric) GetIPv6(key string, nullable bool) interface{}
func (*GjsonMetric) GetInt16 ¶
func (c *GjsonMetric) GetInt16(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetInt32 ¶
func (c *GjsonMetric) GetInt32(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetInt64 ¶
func (c *GjsonMetric) GetInt64(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetInt8 ¶
func (c *GjsonMetric) GetInt8(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetNewKeys ¶
func (*GjsonMetric) GetString ¶
func (c *GjsonMetric) GetString(key string, nullable bool) interface{}
func (*GjsonMetric) GetUUID ¶ added in v0.2.0
func (c *GjsonMetric) GetUUID(key string, nullable bool) interface{}
func (*GjsonMetric) GetUint16 ¶
func (c *GjsonMetric) GetUint16(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetUint32 ¶
func (c *GjsonMetric) GetUint32(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetUint64 ¶
func (c *GjsonMetric) GetUint64(key string, nullable bool) (val interface{})
func (*GjsonMetric) GetUint8 ¶
func (c *GjsonMetric) GetUint8(key string, nullable bool) (val interface{})
type GjsonParser ¶
type GjsonParser struct {
// contains filtered or unexported fields
}
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool may be used for pooling Parsers for similarly typed JSONs.
func NewParserPool ¶
func NewParserPool( name string, csvFormat []string, delimiter string, timezone string, timeunit float64, topic string, schemaRegistry schemaregistry.Client, ) (pp *Pool, err error)
NewParserPool creates a parser pool
func (*Pool) ParseDateTime ¶
Assuming that all values of a field of kafka message has the same layout, and layouts of each field are unrelated. Automatically detect the layout from till the first successful detection and reuse that layout forever. Return time in UTC.
type ProtoDeserializer ¶
type ProtoDeserializer struct {
// contains filtered or unexported fields
}
ProtoDeserializer represents a Protobuf deserializer.
func (*ProtoDeserializer) ToDynamicMessage ¶
func (p *ProtoDeserializer) ToDynamicMessage(bytes []byte) (*dynamic.Message, error)
type ProtoMetric ¶
type ProtoMetric struct {
// contains filtered or unexported fields
}
func (*ProtoMetric) GetArray ¶
func (m *ProtoMetric) GetArray(key string, t int) interface{}
func (*ProtoMetric) GetBool ¶
func (m *ProtoMetric) GetBool(key string, nullable bool) interface{}
func (*ProtoMetric) GetDateTime ¶
func (m *ProtoMetric) GetDateTime(key string, nullable bool) interface{}
func (*ProtoMetric) GetDecimal ¶
func (m *ProtoMetric) GetDecimal(key string, nullable bool) interface{}
func (*ProtoMetric) GetFloat32 ¶
func (m *ProtoMetric) GetFloat32(key string, nullable bool) interface{}
func (*ProtoMetric) GetFloat64 ¶
func (m *ProtoMetric) GetFloat64(key string, nullable bool) interface{}
func (*ProtoMetric) GetIPv4 ¶ added in v0.4.0
func (m *ProtoMetric) GetIPv4(key string, nullable bool) interface{}
func (*ProtoMetric) GetIPv6 ¶ added in v0.4.0
func (m *ProtoMetric) GetIPv6(key string, nullable bool) interface{}
func (*ProtoMetric) GetInt16 ¶
func (m *ProtoMetric) GetInt16(key string, nullable bool) interface{}
func (*ProtoMetric) GetInt32 ¶
func (m *ProtoMetric) GetInt32(key string, nullable bool) interface{}
func (*ProtoMetric) GetInt64 ¶
func (m *ProtoMetric) GetInt64(key string, nullable bool) interface{}
func (*ProtoMetric) GetInt8 ¶
func (m *ProtoMetric) GetInt8(key string, nullable bool) interface{}
func (*ProtoMetric) GetNewKeys ¶
func (*ProtoMetric) GetString ¶
func (m *ProtoMetric) GetString(key string, nullable bool) interface{}
func (*ProtoMetric) GetUUID ¶ added in v0.2.0
func (m *ProtoMetric) GetUUID(key string, nullable bool) interface{}
func (*ProtoMetric) GetUint16 ¶
func (m *ProtoMetric) GetUint16(key string, nullable bool) interface{}
func (*ProtoMetric) GetUint32 ¶
func (m *ProtoMetric) GetUint32(key string, nullable bool) interface{}
func (*ProtoMetric) GetUint64 ¶
func (m *ProtoMetric) GetUint64(key string, nullable bool) interface{}
func (*ProtoMetric) GetUint8 ¶
func (m *ProtoMetric) GetUint8(key string, nullable bool) interface{}
type ProtoParser ¶
type ProtoParser struct {
// contains filtered or unexported fields
}
ProtoParser knows how to get data from proto format.