v1

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1 implements helpers to access data defined by API v1.

Index

Constants

This section is empty.

Variables

View Source
var (
	// TagFlag is a flag suffix to identify the encoding method.
	TagFlag = make([]byte, fieldFlagLength)
)

Functions

func DecodeFieldFlag added in v0.2.0

func DecodeFieldFlag(key []byte) (*databasev1.FieldSpec, time.Duration, error)

DecodeFieldFlag decodes the encoding method, compression method, and interval from bytes.

func DecodeFieldValue added in v0.2.0

func DecodeFieldValue(fieldValue []byte, fieldSpec *databasev1.FieldSpec) (*modelv1.FieldValue, error)

DecodeFieldValue decodes bytes to field value based on its specification.

func EncodeFamily added in v0.2.0

func EncodeFamily(familySpec *databasev1.TagFamilySpec, family *modelv1.TagFamilyForWrite) ([]byte, error)

EncodeFamily encodes a tag family to bytes by referring to its specification.

func EncoderFieldFlag added in v0.2.0

func EncoderFieldFlag(fieldSpec *databasev1.FieldSpec, interval time.Duration) []byte

EncoderFieldFlag encodes the encoding method, compression method, and interval into bytes.

func FieldValueTypeConv

func FieldValueTypeConv(fieldValue *modelv1.FieldValue) (tagType databasev1.FieldType, isNull bool)

FieldValueTypeConv recognizes the field type from its value.

func FindTagByName

func FindTagByName(families []*databasev1.TagFamilySpec, tagName string) (int, int, *databasev1.TagSpec)

FindTagByName finds TagSpec in several tag families by its name. The tag name should be unique in these families.

func MarshalTagValue added in v0.3.0

func MarshalTagValue(tagValue *modelv1.TagValue) ([]byte, error)

MarshalTagValue encodes modelv1.TagValue to bytes.

Types

type TagValue added in v0.3.0

type TagValue struct {
	// contains filtered or unexported fields
}

TagValue seels single value and array value.

func ParseTagValue added in v0.3.0

func ParseTagValue(tagValue *modelv1.TagValue) (TagValue, error)

ParseTagValue decodes modelv1.TagValue to TagValue.

func (TagValue) GetArr added in v0.3.0

func (fv TagValue) GetArr() [][]byte

GetArr returns the array value.

func (TagValue) GetValue added in v0.3.0

func (fv TagValue) GetValue() []byte

GetValue returns the single value.

Directories

Path Synopsis
Package tsdb implements helpers around tsdb.IntervalRule.
Package tsdb implements helpers around tsdb.IntervalRule.

Jump to

Keyboard shortcuts

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