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.
Index ¶
- Constants
- func GetTypeName(typ int) (name string)
- func GetValueByType(metric Metric, cwt *ColumnWithType) interface{}
- type Batch
- type BatchRange
- type ColumnWithType
- type DimMetrics
- type InputMessage
- type Metric
- type MsgRow
- type OrderedMap
- type RecordMap
- type Row
- type Rows
- type SeriesQuota
- type TypeInfo
Constants ¶
const ( Unknown = iota Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Decimal DateTime String UUID Object Map IPv4 IPv6 JSON )
Variables ¶
This section is empty.
Functions ¶
func GetTypeName ¶
GetTypeName returns the column type in ClickHouse
func GetValueByType ¶
func GetValueByType(metric Metric, cwt *ColumnWithType) interface{}
Types ¶
type BatchRange ¶ added in v0.5.0
type ColumnWithType ¶
type ColumnWithType struct {
Name string
Type *TypeInfo
SourceName string
NotNullable bool
// Const is used to set column value to some constant from config.
Const string
}
ColumnWithType
type DimMetrics ¶
type DimMetrics struct {
Dims []*ColumnWithType
Fields []*ColumnWithType
}
DimMetrics
type InputMessage ¶
type InputMessage struct {
Topic string
Partition int
Key []byte
Value []byte
Offset int64
Timestamp *time.Time
}
MsgWithMeta abstract messages We are not using interface because virtual call. See https://syslog.ravelin.com/go-interfaces-but-at-what-cost-961e0f58a07b?gi=58f6761d1d70
type Metric ¶
type Metric interface {
GetBool(key string, nullable bool) interface{}
GetInt8(key string, nullable bool) interface{}
GetInt16(key string, nullable bool) interface{}
GetInt32(key string, nullable bool) interface{}
GetInt64(key string, nullable bool) interface{}
GetUint8(key string, nullable bool) interface{}
GetUint16(key string, nullable bool) interface{}
GetUint32(key string, nullable bool) interface{}
GetUint64(key string, nullable bool) interface{}
GetFloat32(key string, nullable bool) interface{}
GetFloat64(key string, nullable bool) interface{}
GetDecimal(key string, nullable bool) interface{}
GetDateTime(key string, nullable bool) interface{}
GetString(key string, nullable bool) interface{}
GetUUID(key string, nullable bool) interface{}
GetObject(key string, nullable bool) interface{}
GetMap(key string, typeinfo *TypeInfo) interface{}
GetArray(key string, t int) interface{}
GetIPv4(key string, nullable bool) interface{}
GetIPv6(key string, nullable bool) interface{}
GetNewKeys(knownKeys, newKeys, warnKeys *sync.Map, white, black *regexp.Regexp, partition int, offset int64) bool
}
Metric interface for metric collection
type MsgRow ¶
type MsgRow struct {
Msg *InputMessage
Row *Row
Shard int
}
type OrderedMap ¶ added in v0.5.0
type OrderedMap struct {
// contains filtered or unexported fields
}
struct for ingesting a clickhouse Map type value
func NewOrderedMap ¶ added in v0.5.0
func NewOrderedMap() *OrderedMap
func (*OrderedMap) Get ¶ added in v0.5.0
func (om *OrderedMap) Get(key interface{}) (interface{}, bool)
func (*OrderedMap) GetValues ¶ added in v0.5.0
func (om *OrderedMap) GetValues() map[interface{}]interface{}
func (*OrderedMap) Keys ¶ added in v0.5.0
func (om *OrderedMap) Keys() <-chan interface{}
func (*OrderedMap) Put ¶ added in v0.5.0
func (om *OrderedMap) Put(key interface{}, value interface{})
type RecordMap ¶ added in v0.5.0
type RecordMap = map[string]map[int32]*BatchRange