Documentation ¶
Overview ¶
Package point implements datakits basic data structure.
Index ¶
- Constants
- Variables
- func AnyRaw(x *types.Any) (any, error)
- func ClearPointPool()
- func GetCfg(opts ...Option) *cfg
- func MustAnyRaw(x *types.Any) any
- func MustNewAny(x proto.Message) *types.Any
- func MustNewAnyArray(a ...any) *types.Any
- func MustNewBoolArray(b ...bool) *types.Any
- func MustNewBytesArray(bytes ...[]byte) *types.Any
- func MustNewFloatArray[T float32 | float64](f ...T) *types.Any
- func MustNewIntArray[T int8 | int16 | int | int32 | int64](i ...T) *types.Any
- func MustNewStringArray(s ...string) *types.Any
- func MustNewUintArray[T uint16 | uint | uint32 | uint64](i ...T) *types.Any
- func NewAny(x proto.Message) (*types.Any, error)
- func NewAnyArray(a ...any) (*types.Any, error)
- func NewBoolArray(b ...bool) (*types.Any, error)
- func NewBytesArray(bytes ...[]byte) (*types.Any, error)
- func NewFloatArray[T float32 | float64](f ...T) (*types.Any, error)
- func NewIntArray[T int8 | int16 | int | int32 | int64](i ...T) (*types.Any, error)
- func NewRander(opts ...RandOption) *ptRander
- func NewStringArray(s ...string) (*types.Any, error)
- func NewUintArray[T uint16 | uint | uint32 | uint64](i ...T) (*types.Any, error)
- func PB2LP(pb []byte) (lp []byte, err error)
- func PutCfg(c *cfg)
- func PutDecoder(d *Decoder)
- func PutEncoder(e *Encoder)
- func SetPointPool(pp PointPool)
- func SortByTime(pts []*Point)
- type AnyDemo
- func (*AnyDemo) Descriptor() ([]byte, []int)
- func (this *AnyDemo) Equal(that interface{}) bool
- func (m *AnyDemo) GetDemo() string
- func (this *AnyDemo) GoString() string
- func (m *AnyDemo) Marshal() (dAtA []byte, err error)
- func (m *AnyDemo) MarshalTo(dAtA []byte) (int, error)
- func (m *AnyDemo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AnyDemo) ProtoMessage()
- func (m *AnyDemo) Reset()
- func (m *AnyDemo) Size() (n int)
- func (this *AnyDemo) String() string
- func (m *AnyDemo) Unmarshal(dAtA []byte) error
- func (m *AnyDemo) XXX_DiscardUnknown()
- func (m *AnyDemo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AnyDemo) XXX_Merge(src proto.Message)
- func (m *AnyDemo) XXX_Size() int
- func (m *AnyDemo) XXX_Unmarshal(b []byte) error
- type Array
- func (*Array) Descriptor() ([]byte, []int)
- func (this *Array) Equal(that interface{}) bool
- func (m *Array) GetArr() []*BasicTypes
- func (this *Array) GoString() string
- func (m *Array) Marshal() (dAtA []byte, err error)
- func (m *Array) MarshalTo(dAtA []byte) (int, error)
- func (m *Array) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Array) ProtoMessage()
- func (m *Array) Reset()
- func (m *Array) Size() (n int)
- func (this *Array) String() string
- func (m *Array) Unmarshal(dAtA []byte) error
- func (m *Array) XXX_DiscardUnknown()
- func (m *Array) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Array) XXX_Merge(src proto.Message)
- func (m *Array) XXX_Size() int
- func (m *Array) XXX_Unmarshal(b []byte) error
- type BasicTypes
- func (*BasicTypes) Descriptor() ([]byte, []int)
- func (this *BasicTypes) Equal(that interface{}) bool
- func (m *BasicTypes) GetB() bool
- func (m *BasicTypes) GetD() []byte
- func (m *BasicTypes) GetF() float64
- func (m *BasicTypes) GetI() int64
- func (m *BasicTypes) GetS() string
- func (m *BasicTypes) GetU() uint64
- func (m *BasicTypes) GetX() isBasicTypes_X
- func (this *BasicTypes) GoString() string
- func (m *BasicTypes) Marshal() (dAtA []byte, err error)
- func (m *BasicTypes) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BasicTypes) ProtoMessage()
- func (m *BasicTypes) Reset()
- func (m *BasicTypes) Size() (n int)
- func (this *BasicTypes) String() string
- func (m *BasicTypes) Unmarshal(dAtA []byte) error
- func (m *BasicTypes) XXX_DiscardUnknown()
- func (m *BasicTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BasicTypes) XXX_Merge(src proto.Message)
- func (*BasicTypes) XXX_OneofWrappers() []interface{}
- func (m *BasicTypes) XXX_Size() int
- func (m *BasicTypes) XXX_Unmarshal(b []byte) error
- type BasicTypes_B
- func (this *BasicTypes_B) Equal(that interface{}) bool
- func (this *BasicTypes_B) GoString() string
- func (m *BasicTypes_B) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_B) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_B) Size() (n int)
- func (this *BasicTypes_B) String() string
- type BasicTypes_D
- func (this *BasicTypes_D) Equal(that interface{}) bool
- func (this *BasicTypes_D) GoString() string
- func (m *BasicTypes_D) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_D) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_D) Size() (n int)
- func (this *BasicTypes_D) String() string
- type BasicTypes_F
- func (this *BasicTypes_F) Equal(that interface{}) bool
- func (this *BasicTypes_F) GoString() string
- func (m *BasicTypes_F) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_F) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_F) Size() (n int)
- func (this *BasicTypes_F) String() string
- type BasicTypes_I
- func (this *BasicTypes_I) Equal(that interface{}) bool
- func (this *BasicTypes_I) GoString() string
- func (m *BasicTypes_I) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_I) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_I) Size() (n int)
- func (this *BasicTypes_I) String() string
- type BasicTypes_S
- func (this *BasicTypes_S) Equal(that interface{}) bool
- func (this *BasicTypes_S) GoString() string
- func (m *BasicTypes_S) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_S) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_S) Size() (n int)
- func (this *BasicTypes_S) String() string
- type BasicTypes_U
- func (this *BasicTypes_U) Equal(that interface{}) bool
- func (this *BasicTypes_U) GoString() string
- func (m *BasicTypes_U) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_U) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_U) Size() (n int)
- func (this *BasicTypes_U) String() string
- type Callback
- type Category
- type Debug
- func (*Debug) Descriptor() ([]byte, []int)
- func (this *Debug) Equal(that interface{}) bool
- func (m *Debug) GetInfo() string
- func (this *Debug) GoString() string
- func (m *Debug) Marshal() (dAtA []byte, err error)
- func (m *Debug) MarshalTo(dAtA []byte) (int, error)
- func (m *Debug) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Debug) ProtoMessage()
- func (m *Debug) Reset()
- func (m *Debug) Size() (n int)
- func (this *Debug) String() string
- func (m *Debug) Unmarshal(dAtA []byte) error
- func (m *Debug) XXX_DiscardUnknown()
- func (m *Debug) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Debug) XXX_Merge(src proto.Message)
- func (m *Debug) XXX_Size() int
- func (m *Debug) XXX_Unmarshal(b []byte) error
- type DecodeFn
- type Decoder
- type DecoderOption
- type EncodeFn
- type Encoder
- type EncoderOption
- type Encoding
- type EqualOption
- type Field
- func (*Field) Descriptor() ([]byte, []int)
- func (this *Field) Equal(that interface{}) bool
- func (m *Field) GetA() *types.Any
- func (m *Field) GetB() bool
- func (m *Field) GetD() []byte
- func (m *Field) GetF() float64
- func (m *Field) GetI() int64
- func (m *Field) GetIsTag() bool
- func (m *Field) GetKey() string
- func (m *Field) GetS() string
- func (m *Field) GetType() MetricType
- func (m *Field) GetU() uint64
- func (m *Field) GetUnit() string
- func (m *Field) GetVal() isField_Val
- func (this *Field) GoString() string
- func (m *Field) Marshal() (dAtA []byte, err error)
- func (m *Field) MarshalTo(dAtA []byte) (int, error)
- func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Field) ProtoMessage()
- func (kv *Field) Raw() any
- func (m *Field) Reset()
- func (m *Field) Size() (n int)
- func (this *Field) String() string
- func (m *Field) Unmarshal(dAtA []byte) error
- func (m *Field) XXX_DiscardUnknown()
- func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Field) XXX_Merge(src proto.Message)
- func (*Field) XXX_OneofWrappers() []interface{}
- func (m *Field) XXX_Size() int
- func (m *Field) XXX_Unmarshal(b []byte) error
- type Field_A
- type Field_B
- type Field_D
- type Field_F
- type Field_I
- type Field_S
- type Field_U
- type JSONPoint
- type KVOption
- type KVs
- func (x KVs) Add(k string, v any, isTag, force bool) KVs
- func (x KVs) AddKV(kv *Field, force bool) KVs
- func (x KVs) AddTag(k, v string) KVs
- func (x KVs) AddV2(k string, v any, force bool, opts ...KVOption) KVs
- func (x KVs) Del(k string) KVs
- func (x KVs) FieldCount() (i int)
- func (x KVs) Fields() (arr KVs)
- func (x KVs) Get(k string) *Field
- func (x KVs) GetTag(k string) string
- func (x KVs) Has(k string) bool
- func (x KVs) InfluxFields() map[string]any
- func (x KVs) InfluxTags() (res influxm.Tags)
- func (x KVs) Keys() *Keys
- func (x KVs) Len() int
- func (x KVs) Less(i, j int) bool
- func (x KVs) MustAddKV(kv *Field) KVs
- func (x KVs) MustAddTag(k, v string) KVs
- func (x KVs) Pretty() string
- func (x KVs) PrettySorted() string
- func (x KVs) Reset()
- func (x KVs) ResetFull()
- func (x KVs) Swap(i, j int)
- func (x KVs) TagCount() (i int)
- func (x KVs) Tags() (arr KVs)
- func (x KVs) TrimFields(n int) (arr KVs)
- func (x KVs) TrimTags(n int) (arr KVs)
- type Key
- type KeyType
- type Keys
- type Map
- func (*Map) Descriptor() ([]byte, []int)
- func (this *Map) Equal(that interface{}) bool
- func (m *Map) GetMap() map[string]*BasicTypes
- func (this *Map) GoString() string
- func (m *Map) Marshal() (dAtA []byte, err error)
- func (m *Map) MarshalTo(dAtA []byte) (int, error)
- func (m *Map) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Map) ProtoMessage()
- func (m *Map) Reset()
- func (m *Map) Size() (n int)
- func (this *Map) String() string
- func (m *Map) Unmarshal(dAtA []byte) error
- func (m *Map) XXX_DiscardUnknown()
- func (m *Map) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Map) XXX_Merge(src proto.Message)
- func (m *Map) XXX_Size() int
- func (m *Map) XXX_Unmarshal(b []byte) error
- type MetricType
- type Option
- func CommonLoggingOptions() []Option
- func DefaultLoggingOptions() []Option
- func DefaultMetricOptions() []Option
- func DefaultMetricOptionsForInflux1X() []Option
- func DefaultObjectOptions() []Option
- func WithCallback(fn Callback) Option
- func WithDisabledKeys(keys ...*Key) Option
- func WithDotInKey(on bool) Option
- func WithEncoding(enc Encoding) Option
- func WithExtraTags(tags map[string]string) Option
- func WithKeySorted(on bool) Option
- func WithMaxFieldKeyLen(n int) Option
- func WithMaxFieldValLen(n int) Option
- func WithMaxFields(n int) Option
- func WithMaxKVComposeLen(n int) Option
- func WithMaxMeasurementLen(n int) Option
- func WithMaxTagKeyLen(n int) Option
- func WithMaxTagValLen(n int) Option
- func WithMaxTags(n int) Option
- func WithPrecheck(on bool) Option
- func WithPrecision(p Precision) Option
- func WithRequiredKeys(keys ...*Key) Option
- func WithStrField(on bool) Option
- func WithTime(t time.Time) Option
- func WithTimestamp(ts int64) Option
- func WithU64Field(on bool) Option
- type PBPoint
- func (*PBPoint) Descriptor() ([]byte, []int)
- func (this *PBPoint) Equal(that interface{}) bool
- func (m *PBPoint) GetDebugs() []*Debug
- func (m *PBPoint) GetFields() []*Field
- func (m *PBPoint) GetName() string
- func (m *PBPoint) GetTime() int64
- func (m *PBPoint) GetWarns() []*Warn
- func (this *PBPoint) GoString() string
- func (m *PBPoint) Marshal() (dAtA []byte, err error)
- func (m *PBPoint) MarshalTo(dAtA []byte) (int, error)
- func (m *PBPoint) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PBPoint) ProtoMessage()
- func (m *PBPoint) Reset()
- func (m *PBPoint) Size() (n int)
- func (this *PBPoint) String() string
- func (m *PBPoint) Unmarshal(dAtA []byte) error
- func (m *PBPoint) XXX_DiscardUnknown()
- func (m *PBPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PBPoint) XXX_Merge(src proto.Message)
- func (m *PBPoint) XXX_Size() int
- func (m *PBPoint) XXX_Unmarshal(b []byte) error
- type PBPoints
- func (*PBPoints) Descriptor() ([]byte, []int)
- func (this *PBPoints) Equal(that interface{}) bool
- func (m *PBPoints) GetArr() []*PBPoint
- func (this *PBPoints) GoString() string
- func (m *PBPoints) Marshal() (dAtA []byte, err error)
- func (m *PBPoints) MarshalTo(dAtA []byte) (int, error)
- func (m *PBPoints) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PBPoints) ProtoMessage()
- func (m *PBPoints) Reset()
- func (m *PBPoints) Size() (n int)
- func (this *PBPoints) String() string
- func (m *PBPoints) Unmarshal(dAtA []byte) error
- func (m *PBPoints) XXX_DiscardUnknown()
- func (m *PBPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PBPoints) XXX_Merge(src proto.Message)
- func (m *PBPoints) XXX_Size() int
- func (m *PBPoints) XXX_Unmarshal(b []byte) error
- type Point
- func CheckPoints(pts []*Point, opts ...Option) (arr []*Point)
- func FromModelsLP(lp influxm.Point) *Point
- func FromPB(pb *PBPoint) *Point
- func FromPBJson(j []byte) (*Point, error)
- func GatherPoints(reg prometheus.Gatherer) ([]*Point, error)
- func MustFromPBJson(j []byte) *Point
- func NewLPPoint(lp influxm.Point) *Point
- func NewPoint(name string, tags map[string]string, fields map[string]any, opts ...Option) (*Point, error)deprecated
- func NewPointV2(name string, kvs KVs, opts ...Option) *Point
- func RandPoints(count int) []*Point
- func WrapPoint(pts []influxm.Point) (arr []*Point)
- func (p *Point) Add(k string, v any)
- func (p *Point) AddDebug(d *Debug)
- func (p *Point) AddKVs(kvs ...*Field)
- func (p *Point) AddTag(k, v string)
- func (p *Point) ClearFlag(f uint64)
- func (p *Point) CopyField(kvs ...*Field)
- func (p *Point) CopyTags(kvs ...*Field)
- func (p *Point) Del(k string)
- func (p *Point) Equal(x *Point, opts ...EqualOption) bool
- func (p *Point) EqualWithReason(x *Point, opts ...EqualOption) (bool, string)
- func (p *Point) Fields() (arr KVs)
- func (p *Point) Get(k string) any
- func (p *Point) GetTag(k string) string
- func (p *Point) HasFlag(f uint) bool
- func (p *Point) InfluxFields() map[string]any
- func (p *Point) InfluxTags() influxm.Tags
- func (p *Point) KVMap() map[string]any
- func (p *Point) KVs() (arr KVs)
- func (p *Point) Keys() *Keys
- func (p *Point) LPPoint() (influxm.Point, error)
- func (p *Point) LPSize() int
- func (p *Point) LineProto(prec ...Precision) string
- func (p *Point) MD5() string
- func (p *Point) MapTags() map[string]string
- func (p *Point) MarshalJSON() ([]byte, error)
- func (p *Point) MustAdd(k string, v any)
- func (p *Point) MustAddKVs(kvs ...*Field)
- func (p *Point) MustAddTag(k, v string)
- func (p *Point) MustLPPoint() influxm.Point
- func (p *Point) Name() string
- func (p *Point) PBJson() ([]byte, error)
- func (p *Point) PBJsonPretty() ([]byte, error)
- func (p *Point) PBPoint() *PBPoint
- func (p *Point) PBSize() int
- func (p *Point) Pretty() string
- func (p *Point) Reset()
- func (p *Point) SetFlag(f uint)
- func (p *Point) SetKVs(kvs ...*Field)
- func (p *Point) SetName(name string)
- func (p *Point) SetTime(t time.Time)
- func (p *Point) Sha256() string
- func (p *Point) Size() int
- func (p *Point) Tags() (arr KVs)
- func (p *Point) Time() time.Time
- func (p *Point) TimeSeriesHash() []string
- func (p *Point) UnmarshalJSON(j []byte) error
- func (p *Point) Warns() []*Warn
- func (p *Point) WarnsPretty() string
- type PointPool
- type Points
- type Precision
- type RandOption
- func WithCategory(c Category) RandOption
- func WithFixedKeys(on bool) RandOption
- func WithFixedTags(on bool) RandOption
- func WithKVSorted(on bool) RandOption
- func WithRandFields(n int) RandOption
- func WithRandKeyLen(n int) RandOption
- func WithRandMeasurementPrefix(s string) RandOption
- func WithRandPB(on bool) RandOption
- func WithRandSampleText(st []string) RandOption
- func WithRandStringValues(on bool) RandOption
- func WithRandTags(n int) RandOption
- func WithRandText(n int) RandOption
- func WithRandTime(t time.Time) RandOption
- func WithRandValLen(n int) RandOption
- type ReservedCapPointPool
- func (cpp *ReservedCapPointPool) Collect(ch chan<- p8s.Metric)
- func (cpp *ReservedCapPointPool) Describe(ch chan<- *p8s.Desc)
- func (cpp *ReservedCapPointPool) Get() *Point
- func (cpp *ReservedCapPointPool) GetKV(k string, v any) *Field
- func (cpp *ReservedCapPointPool) Put(p *Point)
- func (cpp *ReservedCapPointPool) PutKV(f *Field)
- func (cpp *ReservedCapPointPool) String() string
- type Warn
- func (*Warn) Descriptor() ([]byte, []int)
- func (this *Warn) Equal(that interface{}) bool
- func (m *Warn) GetMsg() string
- func (m *Warn) GetType() string
- func (this *Warn) GoString() string
- func (m *Warn) Marshal() (dAtA []byte, err error)
- func (m *Warn) MarshalTo(dAtA []byte) (int, error)
- func (m *Warn) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Warn) ProtoMessage()
- func (m *Warn) Reset()
- func (m *Warn) Size() (n int)
- func (this *Warn) String() string
- func (m *Warn) Unmarshal(dAtA []byte) error
- func (m *Warn) XXX_DiscardUnknown()
- func (m *Warn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Warn) XXX_Merge(src proto.Message)
- func (m *Warn) XXX_Size() int
- func (m *Warn) XXX_Unmarshal(b []byte) error
Constants ¶
const ( ArrayFieldType = "type.googleapis.com/point.Array" DictFieldType = "type.googleapis.com/point.Map" )
const ( UnknownCategory Category = iota DynamicDWCategory MetricDeprecated Metric Network KeyEvent Object CustomObject Logging Tracing RUM Security Profiling SUnknownCategory = "unknown" SDynamicDWCategory = "dynamic_dw" // NOTE: not used SMetric = "metric" SMetricDeprecated = "metrics" SNetwork = "network" SKeyEvent = "keyevent" SObject = "object" SCustomObject = "custom_object" SLogging = "logging" STracing = "tracing" SRUM = "rum" SSecurity = "security" SProfiling = "profiling" URLUnknownCategory = "/v1/write/unknown" URLDynamicDWCategory = "/v1/write/dynamic_dw" // NOTE: not used URLMetric = "/v1/write/metric" URLMetricDeprecated = "/v1/write/metrics" URLNetwork = "/v1/write/network" URLKeyEvent = "/v1/write/keyevent" URLObject = "/v1/write/object" URLCustomObject = "/v1/write/custom_object" URLLogging = "/v1/write/logging" URLTracing = "/v1/write/tracing" URLRUM = "/v1/write/rum" URLSecurity = "/v1/write/security" URLProfiling = "/v1/write/profiling" CUnknown = "UNKNOWN" CDynamicDW = "DYNAMIC_DW" CM = "M" CN = "N" CE = "E" CO = "O" CCO = "CO" CL = "L" CT = "T" CR = "R" CS = "S" CP = "P" )
const ( EnvDefaultEncoding = "ENV_DEFAULT_ENCODING" EnvEnableMixedArrayField = "ENV_ENABLE_MIXED_ARRAY_FIELD" EnvEnableDictField = "ENV_ENABLE_DICT_FIELD" )
const ( WarnMaxTags = "exceed_max_tags" WarnMaxFields = "exceed_max_fields" WarnNoField = "no_field" WarnMaxTagKeyLen = "exceed_max_tag_key_len" WarnMaxTagValueLen = "exceed_max_tag_value_len" WarnMaxFieldKeyLen = "exceed_max_field_key_len" WarnMaxFieldValueLen = "exceed_max_field_value_len" WarnMaxFieldValueInt = "exceed_max_field_value_int" WarnInfConvertToMaxValue = "convert_inf_to_max_value" WarnInfConvertToMinValue = "convert_inf_to_min_value" WarnInvalidUTF8String = "invalid_utf8_string" WarnMaxTagKeyValueCompose = "exceed_max_tag_key_value_compose" WarnInvalidTagKey = "invalid_tag_key" WarnInvalidTagValue = "invalid_tag_value" WarnInvalidMeasurement = "invalid_measurement" WarnInvalidFieldValueType = "invalid_field_value_type" WarnAddRequiredKV = "add_required_kv" WarnFieldDisabled = "field_disabled" WarnTagDisabled = "tag_disabled" WarnSameTagFieldKey = "same_tag_field_key" WarnKeyNameConflict = "key_name_conflict" WarnDotInkey = "dot_in_key" WarnNROrTailEscape = "found_new_line_or_tail_espace" WarnFieldB64Encoded = "field_base64_encoded" WarnNilField = "nil_field" )
Point warnnings.
const ( Psent = 1 << iota // The Point has been sent Ppb // the point is Protobuf point Pcheck // checked Ppooled // from point pool )
Variables ¶
var ( // EnableMixedArrayField and EnableDictField used to allow mix-typed array and dict/map // value in point field. // // Currently, GuanceDB backend do NOT support mix-typed array and dict. EnableMixedArrayField = false EnableDictField = false )
var ( ErrNoFields = errors.New("no fields") ErrInvalidLineProtocol = errors.New("invalid lineprotocol") )
var ( ErrInvalidLengthPoint = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPoint = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPoint = fmt.Errorf("proto: unexpected end of group") )
var ( DefaultMeasurementName = "__default" KeyTime = NewKey("time", I) KeyMeasurement = NewKey("measurement", S) KeySource = NewKey("source", S) KeyClass = NewKey("class", S) KeyDate = NewKey("date", I) KeyName = NewKey("name", S, defaultObjectName) KeyStatus = NewKey("status", S, defaultLoggingStatus) )
var (
DefaultEncoding = LineProtocol
)
var KeyType_name = map[int32]string{
0: "X",
1: "I",
2: "U",
3: "F",
4: "B",
5: "D",
6: "NIL",
7: "S",
8: "A",
}
var KeyType_value = map[string]int32{
"X": 0,
"I": 1,
"U": 2,
"F": 3,
"B": 4,
"D": 5,
"NIL": 6,
"S": 7,
"A": 8,
}
var MetricType_name = map[int32]string{
0: "UNSPECIFIED",
1: "COUNT",
2: "RATE",
3: "GAUGE",
}
var MetricType_value = map[string]int32{
"UNSPECIFIED": 0,
"COUNT": 1,
"RATE": 2,
"GAUGE": 3,
}
Functions ¶
func ClearPointPool ¶ added in v1.1.12
func ClearPointPool()
func MustAnyRaw ¶ added in v0.1.6
MustAnyRaw get underlying wrapped value, and panic if any error.
func MustNewAny ¶ added in v0.1.6
MustNewAny create anypb based on exist proto message, and panic if any error.
func MustNewAnyArray ¶ added in v0.1.6
MustNewAnyArray wrapped mix-basic-typed list into types.Any, and panic if any error.
func MustNewBoolArray ¶ added in v0.1.6
MustNewBoolArray wrapped boolean list into types.Any, and panic if any error.
func MustNewBytesArray ¶ added in v1.1.12
MustNewBytesArray wrapped string list into types.Any, and panic if any error.
func MustNewFloatArray ¶ added in v0.1.6
MustNewFloatArray wrapped float list into types.Any, and panic if any error.
func MustNewIntArray ¶ added in v0.1.6
MustNewIntArray wrapped signed int list into types.Any, and panic if any error.
func MustNewStringArray ¶ added in v0.1.6
MustNewStringArray wrapped string list into types.Any, and panic if any error.
func MustNewUintArray ¶ added in v0.1.6
MustNewUintArray wrapped unsigned int list into types.Any, and panic if any error.
func NewAnyArray ¶ added in v0.1.6
NewAnyArray wrapped mix-basic-typed list into types.Any.
func NewBoolArray ¶ added in v0.1.6
NewBoolArray wrapped boolean list into types.Any.
func NewBytesArray ¶ added in v1.1.12
NewBytesArray wrapped string list into types.Any.
func NewFloatArray ¶ added in v0.1.6
NewFloatArray wrapped float list into types.Any.
func NewIntArray ¶ added in v0.1.6
NewIntArray wrapped signed int list into types.Any.
func NewRander ¶
func NewRander(opts ...RandOption) *ptRander
func NewStringArray ¶ added in v0.1.6
NewStringArray wrapped string list into types.Any.
func NewUintArray ¶ added in v0.1.6
NewUintArray wrapped unsigned int list into types.Any.
func PutDecoder ¶
func PutDecoder(d *Decoder)
func PutEncoder ¶
func PutEncoder(e *Encoder)
func SetPointPool ¶ added in v1.1.12
func SetPointPool(pp PointPool)
func SortByTime ¶ added in v0.1.6
func SortByTime(pts []*Point)
SortByTime sort(ASC) pts according to time.
Types ¶
type AnyDemo ¶
type AnyDemo struct {
Demo string `protobuf:"bytes,1,opt,name=demo,proto3" json:"demo,omitempty"`
}
example of pb.Any
func (*AnyDemo) Descriptor ¶
func (*AnyDemo) MarshalToSizedBuffer ¶ added in v1.1.12
func (*AnyDemo) ProtoMessage ¶
func (*AnyDemo) ProtoMessage()
func (*AnyDemo) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *AnyDemo) XXX_DiscardUnknown()
func (*AnyDemo) XXX_Marshal ¶ added in v1.1.12
func (*AnyDemo) XXX_Unmarshal ¶ added in v1.1.12
type Array ¶ added in v0.1.6
type Array struct {
Arr []*BasicTypes `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"`
}
func NewArray ¶ added in v0.1.6
NewArray create array value that can be used in point field. The types within ents can be mixed basic types.
func (*Array) Descriptor ¶ added in v0.1.6
func (*Array) GetArr ¶ added in v0.1.6
func (m *Array) GetArr() []*BasicTypes
func (*Array) MarshalToSizedBuffer ¶ added in v1.1.12
func (*Array) ProtoMessage ¶ added in v0.1.6
func (*Array) ProtoMessage()
func (*Array) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *Array) XXX_DiscardUnknown()
func (*Array) XXX_Marshal ¶ added in v1.1.12
func (*Array) XXX_Unmarshal ¶ added in v1.1.12
type BasicTypes ¶ added in v0.1.6
type BasicTypes struct { // Types that are valid to be assigned to X: // *BasicTypes_I // *BasicTypes_U // *BasicTypes_F // *BasicTypes_B // *BasicTypes_D // *BasicTypes_S X isBasicTypes_X `protobuf_oneof:"x"` }
func (*BasicTypes) Descriptor ¶ added in v0.1.6
func (*BasicTypes) Descriptor() ([]byte, []int)
func (*BasicTypes) Equal ¶ added in v1.1.12
func (this *BasicTypes) Equal(that interface{}) bool
func (*BasicTypes) GetB ¶ added in v0.1.6
func (m *BasicTypes) GetB() bool
func (*BasicTypes) GetD ¶ added in v0.1.6
func (m *BasicTypes) GetD() []byte
func (*BasicTypes) GetF ¶ added in v0.1.6
func (m *BasicTypes) GetF() float64
func (*BasicTypes) GetI ¶ added in v0.1.6
func (m *BasicTypes) GetI() int64
func (*BasicTypes) GetS ¶ added in v0.1.6
func (m *BasicTypes) GetS() string
func (*BasicTypes) GetU ¶ added in v0.1.6
func (m *BasicTypes) GetU() uint64
func (*BasicTypes) GetX ¶ added in v0.1.6
func (m *BasicTypes) GetX() isBasicTypes_X
func (*BasicTypes) GoString ¶ added in v1.1.12
func (this *BasicTypes) GoString() string
func (*BasicTypes) Marshal ¶ added in v1.1.12
func (m *BasicTypes) Marshal() (dAtA []byte, err error)
func (*BasicTypes) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes) ProtoMessage ¶ added in v0.1.6
func (*BasicTypes) ProtoMessage()
func (*BasicTypes) Reset ¶ added in v0.1.6
func (m *BasicTypes) Reset()
func (*BasicTypes) Size ¶ added in v1.1.12
func (m *BasicTypes) Size() (n int)
func (*BasicTypes) String ¶ added in v0.1.6
func (this *BasicTypes) String() string
func (*BasicTypes) Unmarshal ¶ added in v1.1.12
func (m *BasicTypes) Unmarshal(dAtA []byte) error
func (*BasicTypes) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *BasicTypes) XXX_DiscardUnknown()
func (*BasicTypes) XXX_Marshal ¶ added in v1.1.12
func (m *BasicTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BasicTypes) XXX_Merge ¶ added in v1.1.12
func (m *BasicTypes) XXX_Merge(src proto.Message)
func (*BasicTypes) XXX_OneofWrappers ¶ added in v1.1.12
func (*BasicTypes) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*BasicTypes) XXX_Size ¶ added in v1.1.12
func (m *BasicTypes) XXX_Size() int
func (*BasicTypes) XXX_Unmarshal ¶ added in v1.1.12
func (m *BasicTypes) XXX_Unmarshal(b []byte) error
type BasicTypes_B ¶ added in v0.1.6
type BasicTypes_B struct {
B bool `protobuf:"varint,4,opt,name=b,proto3,oneof" json:"b,omitempty"`
}
func (*BasicTypes_B) Equal ¶ added in v1.1.12
func (this *BasicTypes_B) Equal(that interface{}) bool
func (*BasicTypes_B) GoString ¶ added in v1.1.12
func (this *BasicTypes_B) GoString() string
func (*BasicTypes_B) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes_B) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes_B) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes_B) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_B) Size ¶ added in v1.1.12
func (m *BasicTypes_B) Size() (n int)
func (*BasicTypes_B) String ¶ added in v1.1.12
func (this *BasicTypes_B) String() string
type BasicTypes_D ¶ added in v0.1.6
type BasicTypes_D struct {
D []byte `protobuf:"bytes,5,opt,name=d,proto3,oneof" json:"d,omitempty"`
}
func (*BasicTypes_D) Equal ¶ added in v1.1.12
func (this *BasicTypes_D) Equal(that interface{}) bool
func (*BasicTypes_D) GoString ¶ added in v1.1.12
func (this *BasicTypes_D) GoString() string
func (*BasicTypes_D) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes_D) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes_D) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes_D) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_D) Size ¶ added in v1.1.12
func (m *BasicTypes_D) Size() (n int)
func (*BasicTypes_D) String ¶ added in v1.1.12
func (this *BasicTypes_D) String() string
type BasicTypes_F ¶ added in v0.1.6
type BasicTypes_F struct {
F float64 `protobuf:"fixed64,3,opt,name=f,proto3,oneof" json:"f,omitempty"`
}
func (*BasicTypes_F) Equal ¶ added in v1.1.12
func (this *BasicTypes_F) Equal(that interface{}) bool
func (*BasicTypes_F) GoString ¶ added in v1.1.12
func (this *BasicTypes_F) GoString() string
func (*BasicTypes_F) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes_F) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes_F) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes_F) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_F) Size ¶ added in v1.1.12
func (m *BasicTypes_F) Size() (n int)
func (*BasicTypes_F) String ¶ added in v1.1.12
func (this *BasicTypes_F) String() string
type BasicTypes_I ¶ added in v0.1.6
type BasicTypes_I struct {
I int64 `protobuf:"varint,1,opt,name=i,proto3,oneof" json:"i,omitempty"`
}
func (*BasicTypes_I) Equal ¶ added in v1.1.12
func (this *BasicTypes_I) Equal(that interface{}) bool
func (*BasicTypes_I) GoString ¶ added in v1.1.12
func (this *BasicTypes_I) GoString() string
func (*BasicTypes_I) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes_I) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes_I) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes_I) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_I) Size ¶ added in v1.1.12
func (m *BasicTypes_I) Size() (n int)
func (*BasicTypes_I) String ¶ added in v1.1.12
func (this *BasicTypes_I) String() string
type BasicTypes_S ¶ added in v0.1.6
type BasicTypes_S struct {
S string `protobuf:"bytes,6,opt,name=s,proto3,oneof" json:"s,omitempty"`
}
func (*BasicTypes_S) Equal ¶ added in v1.1.12
func (this *BasicTypes_S) Equal(that interface{}) bool
func (*BasicTypes_S) GoString ¶ added in v1.1.12
func (this *BasicTypes_S) GoString() string
func (*BasicTypes_S) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes_S) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes_S) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes_S) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_S) Size ¶ added in v1.1.12
func (m *BasicTypes_S) Size() (n int)
func (*BasicTypes_S) String ¶ added in v1.1.12
func (this *BasicTypes_S) String() string
type BasicTypes_U ¶ added in v0.1.6
type BasicTypes_U struct {
U uint64 `protobuf:"varint,2,opt,name=u,proto3,oneof" json:"u,omitempty"`
}
func (*BasicTypes_U) Equal ¶ added in v1.1.12
func (this *BasicTypes_U) Equal(that interface{}) bool
func (*BasicTypes_U) GoString ¶ added in v1.1.12
func (this *BasicTypes_U) GoString() string
func (*BasicTypes_U) MarshalTo ¶ added in v1.1.12
func (m *BasicTypes_U) MarshalTo(dAtA []byte) (int, error)
func (*BasicTypes_U) MarshalToSizedBuffer ¶ added in v1.1.12
func (m *BasicTypes_U) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_U) Size ¶ added in v1.1.12
func (m *BasicTypes_U) Size() (n int)
func (*BasicTypes_U) String ¶ added in v1.1.12
func (this *BasicTypes_U) String() string
type Debug ¶
type Debug struct {
Info string `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
}
Debug used to attached some debug info for the point, these debug info will encoded into payload, storage can take optional handle on these debug info.
func (*Debug) Descriptor ¶
func (*Debug) MarshalToSizedBuffer ¶ added in v1.1.12
func (*Debug) ProtoMessage ¶
func (*Debug) ProtoMessage()
func (*Debug) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *Debug) XXX_DiscardUnknown()
func (*Debug) XXX_Marshal ¶ added in v1.1.12
func (*Debug) XXX_Unmarshal ¶ added in v1.1.12
type DecodeFn ¶
DecodeFn used to iterate on []*Point payload, if error returned, the iterate terminated.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func GetDecoder ¶
func GetDecoder(opts ...DecoderOption) *Decoder
func (*Decoder) DetailedError ¶
type DecoderOption ¶
type DecoderOption func(e *Decoder)
func WithDecEasyproto ¶ added in v1.1.12
func WithDecEasyproto(on bool) DecoderOption
func WithDecEncoding ¶
func WithDecEncoding(enc Encoding) DecoderOption
func WithDecFn ¶
func WithDecFn(fn DecodeFn) DecoderOption
type EncodeFn ¶
EncodeFn used to iterate on []*Point payload, if error returned, the iterate terminated.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func GetEncoder ¶
func GetEncoder(opts ...EncoderOption) *Encoder
func (*Encoder) Encode ¶
Encode get bytes form of multiple Points, often used to Write to somewhere(file/network/...), batchSize used to split huge points into multiple part. Set batchSize to 0 to disable the split.
type EncoderOption ¶
type EncoderOption func(e *Encoder)
func WithEncBatchBytes ¶ added in v0.1.6
func WithEncBatchBytes(bytes int) EncoderOption
func WithEncBatchSize ¶
func WithEncBatchSize(size int) EncoderOption
func WithEncEncoding ¶
func WithEncEncoding(enc Encoding) EncoderOption
func WithEncFn ¶
func WithEncFn(fn EncodeFn) EncoderOption
type Encoding ¶
type Encoding int
func EncodingStr ¶
EncodingStr convert encoding-string in configure file to encoding enum.
Here v1/v2 are alias for lineprotocol and protobuf, this makes people easy to switch between lineprotocol and protobuf. For json, you should not configure json encoding in production environments(json do not classify int and float).
func HTTPContentType ¶ added in v0.1.5
HTTPContentType detect HTTP body content encoding according to header Content-Type.
func (Encoding) HTTPContentType ¶ added in v0.1.5
HTTPContentType get correct HTTP Content-Type value on different body encoding.
type EqualOption ¶ added in v1.1.15
type EqualOption func(*eqopt)
func EqualWithMeasurement ¶ added in v1.1.15
func EqualWithMeasurement(on bool) EqualOption
EqualWithMeasurement set compare on points with/without measurement.
func EqualWithoutKeys ¶ added in v1.1.15
func EqualWithoutKeys(keys ...string) EqualOption
EqualWithoutKeys set compare on points without specific keys.
type Field ¶
type Field struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // See https://developers.google.com/protocol-buffers/docs/proto3#json // // Types that are valid to be assigned to Val: // *Field_I // *Field_U // *Field_F // *Field_B // *Field_D // *Field_S // *Field_A Val isField_Val `protobuf_oneof:"val"` IsTag bool `protobuf:"varint,8,opt,name=is_tag,proto3" json:"is_tag,omitempty"` Type MetricType `protobuf:"varint,9,opt,name=type,proto3,enum=point.MetricType" json:"type,omitempty"` // field unit name Unit string `protobuf:"bytes,10,opt,name=unit,proto3" json:"unit,omitempty"` }
func (*Field) Descriptor ¶
func (*Field) GetType ¶
func (m *Field) GetType() MetricType
func (*Field) MarshalToSizedBuffer ¶ added in v1.1.12
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
func (*Field) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *Field) XXX_DiscardUnknown()
func (*Field) XXX_Marshal ¶ added in v1.1.12
func (*Field) XXX_OneofWrappers ¶ added in v1.1.12
func (*Field) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Field) XXX_Unmarshal ¶ added in v1.1.12
type Field_A ¶
type Field_A struct {
A *types.Any `protobuf:"bytes,7,opt,name=a,proto3,oneof" json:"a,omitempty"`
}
func (*Field_A) MarshalToSizedBuffer ¶ added in v1.1.12
type Field_B ¶
type Field_B struct {
B bool `protobuf:"varint,5,opt,name=b,proto3,oneof" json:"b,omitempty"`
}
func (*Field_B) MarshalToSizedBuffer ¶ added in v1.1.12
type Field_D ¶
type Field_D struct {
D []byte `protobuf:"bytes,6,opt,name=d,proto3,oneof" json:"d,omitempty"`
}
func (*Field_D) MarshalToSizedBuffer ¶ added in v1.1.12
type Field_F ¶
type Field_F struct {
F float64 `protobuf:"fixed64,4,opt,name=f,proto3,oneof" json:"f,omitempty"`
}
func (*Field_F) MarshalToSizedBuffer ¶ added in v1.1.12
type Field_I ¶
type Field_I struct {
I int64 `protobuf:"varint,2,opt,name=i,proto3,oneof" json:"i,omitempty"`
}
func (*Field_I) MarshalToSizedBuffer ¶ added in v1.1.12
type Field_S ¶ added in v0.1.6
type Field_S struct {
S string `protobuf:"bytes,11,opt,name=s,proto3,oneof" json:"s,omitempty"`
}
func (*Field_S) MarshalToSizedBuffer ¶ added in v1.1.12
type Field_U ¶
type Field_U struct {
U uint64 `protobuf:"varint,3,opt,name=u,proto3,oneof" json:"u,omitempty"`
}
func (*Field_U) MarshalToSizedBuffer ¶ added in v1.1.12
type JSONPoint ¶
type KVOption ¶
type KVOption func(kv *Field)
func WithKVTagSet ¶
func WithKVType ¶
func WithKVType(t MetricType) KVOption
WithKVType set field type(count/gauge/rate).
type KVs ¶
type KVs []*Field
func (KVs) AddV2 ¶ added in v1.1.12
AddV2 add new field with opts. If force enabled, overwrite exist key.
func (KVs) FieldCount ¶
func (KVs) InfluxFields ¶
InfluxFields convert KVs to map structure.
func (KVs) InfluxTags ¶
InfluxTags convert tag KVs to map structure.
func (KVs) MustAddTag ¶
func (KVs) PrettySorted ¶ added in v1.1.15
func (KVs) ResetFull ¶ added in v1.1.12
func (x KVs) ResetFull()
ResetFull reset and reuse key-value.
func (KVs) TrimFields ¶
TrimFields keep max-n field kvs and drop the rest.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is the key-name and it's type composite.
type Map ¶ added in v0.1.6
type Map struct {
Map map[string]*BasicTypes `` /* 147-byte string literal not displayed */
}
func MustNewMap ¶ added in v0.1.6
MustNewMap create map value that can be used in point field, and panic if any error.
func (*Map) Descriptor ¶ added in v0.1.6
func (*Map) GetMap ¶ added in v0.1.6
func (m *Map) GetMap() map[string]*BasicTypes
func (*Map) MarshalToSizedBuffer ¶ added in v1.1.12
func (*Map) ProtoMessage ¶ added in v0.1.6
func (*Map) ProtoMessage()
func (*Map) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *Map) XXX_DiscardUnknown()
func (*Map) XXX_Marshal ¶ added in v1.1.12
func (*Map) XXX_Unmarshal ¶ added in v1.1.12
type MetricType ¶
type MetricType int32
const ( UNSPECIFIED MetricType = 0 COUNT MetricType = 1 RATE MetricType = 2 GAUGE MetricType = 3 )
func (MetricType) EnumDescriptor ¶
func (MetricType) EnumDescriptor() ([]byte, []int)
func (MetricType) String ¶
func (x MetricType) String() string
type Option ¶
type Option func(*cfg)
func CommonLoggingOptions ¶ added in v0.1.1
func CommonLoggingOptions() []Option
CommonLoggingOptions defined options on RUM/Tracing/Security/Event/Profile/Network point.
func DefaultLoggingOptions ¶
func DefaultLoggingOptions() []Option
DefaultLoggingOptions defined options on Logging point.
func DefaultMetricOptions ¶
func DefaultMetricOptions() []Option
DefaultMetricOptions defined options on Metric point.
func DefaultMetricOptionsForInflux1X ¶
func DefaultMetricOptionsForInflux1X() []Option
DefaultMetricOptionsForInflux1X get influxdb 1.x options. For influxdb 1.x, uint64 not support.
func DefaultObjectOptions ¶
func DefaultObjectOptions() []Option
DefaultObjectOptions defined options on Object/CustomObject point.
func WithCallback ¶
func WithDisabledKeys ¶
func WithDotInKey ¶
func WithEncoding ¶
func WithExtraTags ¶
func WithKeySorted ¶ added in v0.1.6
func WithMaxFieldKeyLen ¶
func WithMaxFieldValLen ¶
func WithMaxFields ¶
func WithMaxKVComposeLen ¶
func WithMaxMeasurementLen ¶
func WithMaxTagKeyLen ¶
func WithMaxTagValLen ¶
func WithMaxTags ¶
func WithPrecheck ¶
func WithPrecision ¶
func WithRequiredKeys ¶
func WithStrField ¶
func WithTimestamp ¶ added in v1.1.12
func WithU64Field ¶
type PBPoint ¶
type PBPoint struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` // Auxiliary fields for the point, they should not // write to the final storage on production. Warns []*Warn `protobuf:"bytes,4,rep,name=warns,proto3" json:"warns,omitempty"` Debugs []*Debug `protobuf:"bytes,5,rep,name=debugs,proto3" json:"debugs,omitempty"` }
func (*PBPoint) Descriptor ¶
func (*PBPoint) MarshalToSizedBuffer ¶ added in v1.1.12
func (*PBPoint) ProtoMessage ¶
func (*PBPoint) ProtoMessage()
func (*PBPoint) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *PBPoint) XXX_DiscardUnknown()
func (*PBPoint) XXX_Marshal ¶ added in v1.1.12
func (*PBPoint) XXX_Unmarshal ¶ added in v1.1.12
type PBPoints ¶
type PBPoints struct {
Arr []*PBPoint `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"`
}
batch of pbpoint.
func (*PBPoints) Descriptor ¶
func (*PBPoints) MarshalToSizedBuffer ¶ added in v1.1.12
func (*PBPoints) ProtoMessage ¶
func (*PBPoints) ProtoMessage()
func (*PBPoints) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *PBPoints) XXX_DiscardUnknown()
func (*PBPoints) XXX_Marshal ¶ added in v1.1.12
func (*PBPoints) XXX_Unmarshal ¶ added in v1.1.12
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func CheckPoints ¶ added in v1.1.12
CheckPoints used to check pts on various opts.
func FromModelsLP ¶
func FromPBJson ¶
func GatherPoints ¶ added in v1.1.12
func GatherPoints(reg prometheus.Gatherer) ([]*Point, error)
GatherPoints gather all metrics in global registry, but convert these metrics to Point.
func MustFromPBJson ¶
func NewLPPoint ¶
NewLPPoint create Point based on a lineproto point.
func NewPoint
deprecated
func NewPoint(name string, tags map[string]string, fields map[string]any, opts ...Option) (*Point, error)
NewPoint returns a new Point given name(measurement), tags, fields and optional options.
If fields empty(or nil), error ErrNoField will returned.
Values in fields only allowed for int/uint(8-bit/16-bit/32-bit/64-bit), string, bool, float(32-bit/64-bit) and []byte, other types are ignored.
Deprecated: use NewPointV2.
func (*Point) CopyField ¶ added in v1.1.12
CopyField deep-copy field kvs, if keys exist, do nothing.
func (*Point) Equal ¶
func (p *Point) Equal(x *Point, opts ...EqualOption) bool
Equal test if two point are the same. Equality test NOT check on warns and debugs. If two points equal, they have the same ID(MD5/Sha256), but same ID do not means they are equal.
func (*Point) EqualWithReason ¶
func (p *Point) EqualWithReason(x *Point, opts ...EqualOption) (bool, string)
func (*Point) InfluxFields ¶
InfluxFields convert fields to map structure.
func (*Point) InfluxTags ¶
InfluxTags convert tags to map structure.
func (*Point) LineProto ¶
LineProto convert point to text lineprotocol(both for lineproto point and protobuf point).
func (*Point) MarshalJSON ¶
MarshalJSON to protobuf json.
func (*Point) MustAddKVs ¶ added in v1.1.12
MustAddKVs add kv, if the key exist, override it.
func (*Point) MustAddTag ¶
MustAddTag add specific key value to fields, if k exist, override it.
func (*Point) MustLPPoint ¶ added in v0.1.6
func (*Point) PBJsonPretty ¶
func (*Point) Pretty ¶
Pretty get string representation of point, all key-valus will be sorted in output.
func (*Point) TimeSeriesHash ¶ added in v0.1.8
func (*Point) UnmarshalJSON ¶
UnmarshalJSON unmarshal protobuf json.
func (*Point) WarnsPretty ¶ added in v0.1.6
WarnsPretty return human readable warnning info.
type PointPool ¶ added in v1.1.12
type PointPool interface { Get() *Point Put(*Point) GetKV(k string, v any) *Field PutKV(f *Field) // For prometheus metrics. p8s.Collector }
func GetPointPool ¶ added in v1.1.15
func GetPointPool() PointPool
func NewReservedCapPointPool ¶ added in v1.1.12
type RandOption ¶
type RandOption func(*ptRander)
func WithCategory ¶
func WithCategory(c Category) RandOption
func WithFixedKeys ¶
func WithFixedKeys(on bool) RandOption
func WithFixedTags ¶
func WithFixedTags(on bool) RandOption
func WithKVSorted ¶ added in v0.1.6
func WithKVSorted(on bool) RandOption
func WithRandFields ¶
func WithRandFields(n int) RandOption
func WithRandKeyLen ¶
func WithRandKeyLen(n int) RandOption
func WithRandMeasurementPrefix ¶
func WithRandMeasurementPrefix(s string) RandOption
func WithRandPB ¶
func WithRandPB(on bool) RandOption
func WithRandSampleText ¶ added in v1.1.12
func WithRandSampleText(st []string) RandOption
func WithRandStringValues ¶ added in v1.1.12
func WithRandStringValues(on bool) RandOption
func WithRandTags ¶
func WithRandTags(n int) RandOption
func WithRandText ¶
func WithRandText(n int) RandOption
func WithRandTime ¶
func WithRandTime(t time.Time) RandOption
func WithRandValLen ¶
func WithRandValLen(n int) RandOption
type ReservedCapPointPool ¶ added in v1.1.12
type ReservedCapPointPool struct {
// contains filtered or unexported fields
}
func (*ReservedCapPointPool) Collect ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) Collect(ch chan<- p8s.Metric)
func (*ReservedCapPointPool) Describe ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) Describe(ch chan<- *p8s.Desc)
func (*ReservedCapPointPool) Get ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) Get() *Point
func (*ReservedCapPointPool) GetKV ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) GetKV(k string, v any) *Field
func (*ReservedCapPointPool) Put ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) Put(p *Point)
func (*ReservedCapPointPool) PutKV ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) PutKV(f *Field)
func (*ReservedCapPointPool) String ¶ added in v1.1.12
func (cpp *ReservedCapPointPool) String() string
type Warn ¶
type Warn struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,json=message,proto3" json:"msg,omitempty"` }
Warn used to attach some warning message during building the point.
func (*Warn) Descriptor ¶
func (*Warn) MarshalToSizedBuffer ¶ added in v1.1.12
func (*Warn) ProtoMessage ¶
func (*Warn) ProtoMessage()
func (*Warn) XXX_DiscardUnknown ¶ added in v1.1.12
func (m *Warn) XXX_DiscardUnknown()