Documentation ¶
Overview ¶
Package convert contains various conversions.
Index ¶
- Variables
- func FromSeriesIDAndEncodedTags(id ident.BytesID, encodedTags ts.EncodedTags) (doc.Metadata, error)
- func FromSeriesIDAndTagIter(id ident.ID, tags ident.TagIterator) (doc.Metadata, error)
- func FromSeriesIDAndTags(id ident.ID, tags ident.Tags) (doc.Metadata, error)
- func TagsFromTagsIter(seriesID ident.ID, iter ident.TagIterator, idPool ident.Pool) (ident.Tags, error)
- func ToSeries(d doc.Metadata, opts Opts) (ident.ID, ident.TagIterator, error)
- func ToSeriesTags(d doc.Metadata, opts Opts) ident.TagIterator
- func Validate(d doc.Metadata) error
- func ValidateSeries(id ident.ID, tags ident.Tags) error
- func ValidateSeriesTag(tag ident.Tag) error
- type Opts
- type TagMetadataResolver
Constants ¶
This section is empty.
Variables ¶
var ( // ReservedFieldNameID is the field name used to index the ID in the // m3ninx subsytem. ReservedFieldNameID = doc.IDReservedFieldName // ErrUsingReservedFieldName is the error returned when a metric // cannot be parsed due to using a resereved field name ErrUsingReservedFieldName = errors.New( "unable to parse metric using reserved field name: " + string(ReservedFieldNameID)) )
var ( // EmptyTagMetadataResolver is empty tags iter metadata resolver. EmptyTagMetadataResolver = NewTagsIterMetadataResolver(ident.EmptyTagIterator) // ErrUnknownTagMetadataResolverType is unknown tag metadata resolver type error. ErrUnknownTagMetadataResolverType = errors.New("unknown tag metadata resolver type") )
Functions ¶
func FromSeriesIDAndEncodedTags ¶ added in v1.0.1
FromSeriesIDAndEncodedTags converts the provided series id and encoded tags into a doc.Metadata.
func FromSeriesIDAndTagIter ¶ added in v0.15.4
FromSeriesIDAndTagIter converts the provided series id+tags into a document.
func FromSeriesIDAndTags ¶ added in v0.15.4
FromSeriesIDAndTags converts the provided series id+tags into a document.
func TagsFromTagsIter ¶ added in v0.4.0
func TagsFromTagsIter( seriesID ident.ID, iter ident.TagIterator, idPool ident.Pool, ) (ident.Tags, error)
TagsFromTagsIter returns an ident.Tags from a TagIterator. It also tries to re-use bytes from the seriesID if they're also present in the tags instead of re-allocating them. This requires that the ident.Tags that is returned will have the same (or shorter) life time as the seriesID, otherwise the operation is unsafe.
func ToSeriesTags ¶ added in v0.15.4
func ToSeriesTags(d doc.Metadata, opts Opts) ident.TagIterator
ToSeriesTags converts the provided doc to metric tags.
func ValidateSeries ¶ added in v0.15.0
ValidateSeries will validate a series for use with m3ninx.
func ValidateSeriesTag ¶ added in v0.15.0
ValidateSeriesTag validates a series tag for use with m3ninx.
Types ¶
type Opts ¶
type Opts struct { IdentPool ident.Pool CheckedBytesPool pool.CheckedBytesPool NoClone bool }
Opts are the pools required for conversions.
type TagMetadataResolver ¶ added in v1.2.0
type TagMetadataResolver struct {
// contains filtered or unexported fields
}
TagMetadataResolver represents metadata resolver.
func NewEncodedTagsMetadataResolver ¶ added in v1.2.0
func NewEncodedTagsMetadataResolver(encodedTags ts.EncodedTags) TagMetadataResolver
NewEncodedTagsMetadataResolver returns metadata resolver which accepts encoded tags.
func NewTagsIterMetadataResolver ¶ added in v1.2.0
func NewTagsIterMetadataResolver(tagsIter ident.TagIterator) TagMetadataResolver
NewTagsIterMetadataResolver returns metadata resolver which accepts tags iterator.
func NewTagsMetadataResolver ¶ added in v1.2.0
func NewTagsMetadataResolver(tags ident.Tags) TagMetadataResolver
NewTagsMetadataResolver returns metadata resolver which accepts tags.