convert

package
v0.15.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 8 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
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))
)

Functions

func FromSeriesIDAndTagIter added in v0.15.4

func FromSeriesIDAndTagIter(id ident.ID, tags ident.TagIterator) (doc.Document, error)

FromSeriesIDAndTagIter converts the provided series id+tags into a document.

func FromSeriesIDAndTags added in v0.15.4

func FromSeriesIDAndTags(id ident.ID, tags ident.Tags) (doc.Document, error)

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 ToSeries added in v0.15.4

func ToSeries(d doc.Document, opts Opts) (ident.ID, ident.TagIterator, error)

ToSeries converts the provided doc to metric id+tags.

func ToSeriesTags added in v0.15.4

func ToSeriesTags(d doc.Document, opts Opts) ident.TagIterator

ToSeriesTags converts the provided doc to metric tags.

func Validate added in v0.15.4

func Validate(d doc.Document) error

Validate returns a bool indicating whether the document is valid.

func ValidateSeries added in v0.15.0

func ValidateSeries(id ident.ID, tags ident.Tags) error

ValidateSeries will validate a series for use with m3ninx.

func ValidateSeriesTag added in v0.15.0

func ValidateSeriesTag(tag ident.Tag) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL