Documentation ¶
Overview ¶
Package point implements datakits basic data structure.
Index ¶
- Constants
- Variables
- func AnyRaw(x *anypb.Any) (any, error)
- func GetCfg(opts ...Option) *cfg
- func MustAnyRaw(x *anypb.Any) any
- func MustNewAny(x proto.Message) *anypb.Any
- func MustNewAnyArray(a ...any) *anypb.Any
- func MustNewBoolArray(b ...bool) *anypb.Any
- func MustNewFloatArray[T float32 | float64](f ...T) *anypb.Any
- func MustNewIntArray[T int8 | int16 | int | int32 | int64](i ...T) *anypb.Any
- func MustNewStringArray(s ...string) *anypb.Any
- func MustNewUintArray[T uint16 | uint | uint32 | uint64](i ...T) *anypb.Any
- func NewAny(x proto.Message) (*anypb.Any, error)
- func NewAnyArray(a ...any) (*anypb.Any, error)
- func NewBoolArray(b ...bool) (*anypb.Any, error)
- func NewFloatArray[T float32 | float64](f ...T) (*anypb.Any, error)
- func NewIntArray[T int8 | int16 | int | int32 | int64](i ...T) (*anypb.Any, error)
- func NewRander(opts ...RandOption) *ptRander
- func NewStringArray(s ...string) (*anypb.Any, error)
- func NewUintArray[T uint16 | uint | uint32 | uint64](i ...T) (*anypb.Any, error)
- func PB2LP(pb []byte) (lp []byte, err error)
- func PutCfg(c *cfg)
- func PutDecoder(d *Decoder)
- func PutEncoder(e *Encoder)
- func SortByTime(pts []*Point)
- type AnyDemo
- type Array
- type BasicTypes
- func (*BasicTypes) Descriptor() ([]byte, []int)deprecated
- func (x *BasicTypes) GetB() bool
- func (x *BasicTypes) GetD() []byte
- func (x *BasicTypes) GetF() float64
- func (x *BasicTypes) GetI() int64
- func (x *BasicTypes) GetS() string
- func (x *BasicTypes) GetU() uint64
- func (m *BasicTypes) GetX() isBasicTypes_X
- func (*BasicTypes) ProtoMessage()
- func (x *BasicTypes) ProtoReflect() protoreflect.Message
- func (x *BasicTypes) Reset()
- func (x *BasicTypes) String() string
- type BasicTypes_B
- type BasicTypes_D
- type BasicTypes_F
- type BasicTypes_I
- type BasicTypes_S
- type BasicTypes_U
- type Callback
- type Category
- type Debug
- type DecodeFn
- type Decoder
- type DecoderOption
- type EncodeFn
- type Encoder
- type EncoderOption
- type Encoding
- type Field
- func (*Field) Descriptor() ([]byte, []int)deprecated
- func (x *Field) GetA() *anypb.Any
- func (x *Field) GetB() bool
- func (x *Field) GetD() []byte
- func (x *Field) GetF() float64
- func (x *Field) GetI() int64
- func (x *Field) GetIsTag() bool
- func (x *Field) GetKey() string
- func (x *Field) GetS() string
- func (x *Field) GetType() MetricType
- func (x *Field) GetU() uint64
- func (x *Field) GetUnit() string
- func (m *Field) GetVal() isField_Val
- func (*Field) ProtoMessage()
- func (x *Field) ProtoReflect() protoreflect.Message
- func (kv *Field) Raw() any
- func (x *Field) Reset()
- func (x *Field) String() string
- 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) 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) 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
- 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 WithU64Field(on bool) Option
- type PBPoint
- func (*PBPoint) Descriptor() ([]byte, []int)deprecated
- func (x *PBPoint) GetDebugs() []*Debug
- func (x *PBPoint) GetFields() []*Field
- func (x *PBPoint) GetName() string
- func (x *PBPoint) GetTime() int64
- func (x *PBPoint) GetWarns() []*Warn
- func (*PBPoint) ProtoMessage()
- func (x *PBPoint) ProtoReflect() protoreflect.Message
- func (x *PBPoint) Reset()
- func (x *PBPoint) String() string
- type PBPoints
- type Point
- func FromJSONPoint(j *JSONPoint) *Point
- func FromLP(lp influxm.Point) *Point
- func FromModelsLP(lp influxm.Point) *Point
- func FromPB(pb *PBPoint) *Point
- func FromPBJson(j []byte) (*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) AddKV(kv *Field)
- func (p *Point) AddTag(k, v string)
- func (p *Point) ClearFlag(f uint64)
- func (p *Point) Del(k string)
- func (p *Point) Equal(x *Point) bool
- func (p *Point) EqualWithReason(x *Point) (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) MustAddKV(kv *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) SetFlag(f uint)
- 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) UnmarshalJSON(j []byte) error
- func (p *Point) Warns() []*Warn
- func (p *Point) WarnsPretty() string
- 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 WithRandTags(n int) RandOption
- func WithRandText(n int) RandOption
- func WithRandTime(t time.Time) RandOption
- func WithRandValLen(n int) RandOption
- type Warn
Constants ¶
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 ( 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" 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" WarnDotInkey = "dot_in_key" 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 )
const (
EnvDefaultEncoding = "ENV_DEFAULT_ENCODING"
)
Variables ¶
var ( ErrNoFields = errors.New("no fields") ErrInvalidLineProtocol = errors.New("invalid 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", } KeyType_value = map[string]int32{ "X": 0, "I": 1, "U": 2, "F": 3, "B": 4, "D": 5, "NIL": 6, "S": 7, "A": 8, } )
Enum value maps for KeyType.
var ( MetricType_name = map[int32]string{ 0: "UNSPECIFIED", 1: "COUNT", 2: "RATE", 3: "GAUGE", } MetricType_value = map[string]int32{ "UNSPECIFIED": 0, "COUNT": 1, "RATE": 2, "GAUGE": 3, } )
Enum value maps for MetricType.
var ( DefaultMeasurementName = "__default" KeyTime = NewKey("time", KeyType_I) KeyMeasurement = NewKey("measurement", KeyType_S) KeySource = NewKey("source", KeyType_S) KeyClass = NewKey("class", KeyType_S) KeyDate = NewKey("date", KeyType_I) KeyName = NewKey("name", KeyType_D, []byte(defaultObjectName)) KeyStatus = NewKey("status", KeyType_D, []byte(defaultLoggingStatus)) )
var (
DefaultEncoding = LineProtocol
)
var File_point_proto protoreflect.FileDescriptor
Functions ¶
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 anypb.Any, and panic if any error.
func MustNewBoolArray ¶ added in v0.1.6
MustNewBoolArray wrapped boolean list into anypb.Any, and panic if any error.
func MustNewFloatArray ¶ added in v0.1.6
MustNewFloatArray wrapped float list into anypb.Any, and panic if any error.
func MustNewIntArray ¶ added in v0.1.6
MustNewIntArray wrapped signed int list into anypb.Any, and panic if any error.
func MustNewStringArray ¶ added in v0.1.6
MustNewStringArray wrapped string list into anypb.Any, and panic if any error.
func MustNewUintArray ¶ added in v0.1.6
MustNewUintArray wrapped unsigned int list into anypb.Any, and panic if any error.
func NewAnyArray ¶ added in v0.1.6
NewAnyArray wrapped mix-basic-typed list into anypb.Any.
func NewBoolArray ¶ added in v0.1.6
NewBoolArray wrapped boolean list into anypb.Any.
func NewFloatArray ¶ added in v0.1.6
NewFloatArray wrapped float list into anypb.Any.
func NewIntArray ¶ added in v0.1.6
NewIntArray wrapped signed int list into anypb.Any.
func NewRander ¶
func NewRander(opts ...RandOption) *ptRander
func NewStringArray ¶ added in v0.1.6
NewStringArray wrapped string list into anypb.Any.
func NewUintArray ¶ added in v0.1.6
NewUintArray wrapped unsigned int list into anypb.Any.
func PutDecoder ¶
func PutDecoder(d *Decoder)
func PutEncoder ¶
func PutEncoder(e *Encoder)
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"` // contains filtered or unexported fields }
example of pb.Any
func (*AnyDemo) Descriptor
deprecated
func (*AnyDemo) ProtoMessage ¶
func (*AnyDemo) ProtoMessage()
func (*AnyDemo) ProtoReflect ¶
func (x *AnyDemo) ProtoReflect() protoreflect.Message
type Array ¶ added in v0.1.6
type Array struct { Arr []*BasicTypes `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"` // contains filtered or unexported fields }
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
deprecated
added in
v0.1.6
func (*Array) GetArr ¶ added in v0.1.6
func (x *Array) GetArr() []*BasicTypes
func (*Array) ProtoMessage ¶ added in v0.1.6
func (*Array) ProtoMessage()
func (*Array) ProtoReflect ¶ added in v0.1.6
func (x *Array) ProtoReflect() protoreflect.Message
type BasicTypes ¶ added in v0.1.6
type BasicTypes struct { // Types that are assignable to X: // *BasicTypes_I // *BasicTypes_U // *BasicTypes_F // *BasicTypes_B // *BasicTypes_D // *BasicTypes_S X isBasicTypes_X `protobuf_oneof:"x"` // contains filtered or unexported fields }
func (*BasicTypes) Descriptor
deprecated
added in
v0.1.6
func (*BasicTypes) Descriptor() ([]byte, []int)
Deprecated: Use BasicTypes.ProtoReflect.Descriptor instead.
func (*BasicTypes) GetB ¶ added in v0.1.6
func (x *BasicTypes) GetB() bool
func (*BasicTypes) GetD ¶ added in v0.1.6
func (x *BasicTypes) GetD() []byte
func (*BasicTypes) GetF ¶ added in v0.1.6
func (x *BasicTypes) GetF() float64
func (*BasicTypes) GetI ¶ added in v0.1.6
func (x *BasicTypes) GetI() int64
func (*BasicTypes) GetS ¶ added in v0.1.6
func (x *BasicTypes) GetS() string
func (*BasicTypes) GetU ¶ added in v0.1.6
func (x *BasicTypes) GetU() uint64
func (*BasicTypes) GetX ¶ added in v0.1.6
func (m *BasicTypes) GetX() isBasicTypes_X
func (*BasicTypes) ProtoMessage ¶ added in v0.1.6
func (*BasicTypes) ProtoMessage()
func (*BasicTypes) ProtoReflect ¶ added in v0.1.6
func (x *BasicTypes) ProtoReflect() protoreflect.Message
func (*BasicTypes) Reset ¶ added in v0.1.6
func (x *BasicTypes) Reset()
func (*BasicTypes) String ¶ added in v0.1.6
func (x *BasicTypes) String() string
type BasicTypes_B ¶ added in v0.1.6
type BasicTypes_B struct {
B bool `protobuf:"varint,4,opt,name=b,proto3,oneof"` // bool
}
type BasicTypes_D ¶ added in v0.1.6
type BasicTypes_D struct {
D []byte `protobuf:"bytes,5,opt,name=d,proto3,oneof"` // bytes, for binary data
}
type BasicTypes_F ¶ added in v0.1.6
type BasicTypes_F struct {
F float64 `protobuf:"fixed64,3,opt,name=f,proto3,oneof"` // float64
}
type BasicTypes_I ¶ added in v0.1.6
type BasicTypes_I struct {
I int64 `protobuf:"varint,1,opt,name=i,proto3,oneof"` // signed int
}
type BasicTypes_S ¶ added in v0.1.6
type BasicTypes_S struct {
S string `protobuf:"bytes,6,opt,name=s,proto3,oneof"` // string, for string data
}
type BasicTypes_U ¶ added in v0.1.6
type BasicTypes_U struct {
U uint64 `protobuf:"varint,2,opt,name=u,proto3,oneof"` // unsigned int
}
type Debug ¶
type Debug struct { Info string `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` // contains filtered or unexported fields }
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
deprecated
func (*Debug) ProtoMessage ¶
func (*Debug) ProtoMessage()
func (*Debug) ProtoReflect ¶
func (x *Debug) ProtoReflect() protoreflect.Message
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 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
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
func (Encoding) HTTPContentType ¶ added in v0.1.5
type Field ¶
type Field struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // field name // See https://developers.google.com/protocol-buffers/docs/proto3#json // // Types that are assignable 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"` // set field as a tag or not 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"` // metric unit, such as bytes(B), duration(ms/us) and so on. // contains filtered or unexported fields }
func (*Field) Descriptor
deprecated
func (*Field) GetType ¶
func (x *Field) GetType() MetricType
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
func (*Field) ProtoReflect ¶
func (x *Field) ProtoReflect() protoreflect.Message
type Field_D ¶
type Field_D struct {
D []byte `protobuf:"bytes,6,opt,name=d,proto3,oneof"` // bytes, for binary data
}
type Field_F ¶
type Field_F struct {
F float64 `protobuf:"fixed64,4,opt,name=f,proto3,oneof"` // float64
}
type Field_I ¶
type Field_I struct {
I int64 `protobuf:"varint,2,opt,name=i,proto3,oneof"` // signed int
}
type Field_S ¶ added in v0.1.6
type Field_S struct {
S string `protobuf:"bytes,11,opt,name=s,proto3,oneof"` // string, for string data
}
type Field_U ¶
type Field_U struct {
U uint64 `protobuf:"varint,3,opt,name=u,proto3,oneof"` // unsigned int
}
type JSONPoint ¶
type KVOption ¶
type KVOption func(kv *Field)
func WithKVTagSet ¶
func WithKVType ¶
func WithKVType(t MetricType) KVOption
func WithKVUnit ¶
type KVs ¶
type KVs []*Field
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 ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is the key-name and it's type composite.
type KeyType ¶
type KeyType int32
func (KeyType) Descriptor ¶
func (KeyType) Descriptor() protoreflect.EnumDescriptor
func (KeyType) EnumDescriptor
deprecated
func (KeyType) Number ¶
func (x KeyType) Number() protoreflect.EnumNumber
func (KeyType) Type ¶
func (KeyType) Type() protoreflect.EnumType
type Map ¶ added in v0.1.6
type Map struct { Map map[string]*BasicTypes `` /* 147-byte string literal not displayed */ // contains filtered or unexported fields }
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
deprecated
added in
v0.1.6
func (*Map) GetMap ¶ added in v0.1.6
func (x *Map) GetMap() map[string]*BasicTypes
func (*Map) ProtoMessage ¶ added in v0.1.6
func (*Map) ProtoMessage()
func (*Map) ProtoReflect ¶ added in v0.1.6
func (x *Map) ProtoReflect() protoreflect.Message
type MetricType ¶
type MetricType int32
const ( MetricType_UNSPECIFIED MetricType = 0 MetricType_COUNT MetricType = 1 MetricType_RATE MetricType = 2 MetricType_GAUGE MetricType = 3 )
func (MetricType) Descriptor ¶
func (MetricType) Descriptor() protoreflect.EnumDescriptor
func (MetricType) Enum ¶
func (x MetricType) Enum() *MetricType
func (MetricType) EnumDescriptor
deprecated
func (MetricType) EnumDescriptor() ([]byte, []int)
Deprecated: Use MetricType.Descriptor instead.
func (MetricType) Number ¶
func (x MetricType) Number() protoreflect.EnumNumber
func (MetricType) String ¶
func (x MetricType) String() string
func (MetricType) Type ¶
func (MetricType) Type() protoreflect.EnumType
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 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"` // contains filtered or unexported fields }
func (*PBPoint) Descriptor
deprecated
func (*PBPoint) ProtoMessage ¶
func (*PBPoint) ProtoMessage()
func (*PBPoint) ProtoReflect ¶
func (x *PBPoint) ProtoReflect() protoreflect.Message
type PBPoints ¶
type PBPoints struct { Arr []*PBPoint `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"` // contains filtered or unexported fields }
batch of pbpoint.
func (*PBPoints) Descriptor
deprecated
func (*PBPoints) ProtoMessage ¶
func (*PBPoints) ProtoMessage()
func (*PBPoints) ProtoReflect ¶
func (x *PBPoints) ProtoReflect() protoreflect.Message
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func FromJSONPoint ¶
func FromModelsLP ¶
func FromPBJson ¶
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) Equal ¶
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) 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) 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, suffixed with all warning(if any) during build the point.
func (*Point) UnmarshalJSON ¶
UnmarshalJSON unmarshal protobuf json.
func (*Point) WarnsPretty ¶ added in v0.1.6
WarnsPretty return human readable warnning info.
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 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 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"` // contains filtered or unexported fields }
Warn used to attach some warning message during building the point.
func (*Warn) Descriptor
deprecated
func (*Warn) ProtoMessage ¶
func (*Warn) ProtoMessage()
func (*Warn) ProtoReflect ¶
func (x *Warn) ProtoReflect() protoreflect.Message