otelschema

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package otelschema implements reading OpenTelemetry semantic convention schemas.

See:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appendable

type Appendable interface {
	AppendAttribute(v pcommon.Value)
	AppendZero()
}

Appendable is a column that can append values.

type AppendableColumn

type AppendableColumn interface {
	Appendable
	proto.Column
}

AppendableColumn is a column that can append values.

type Attribute

type Attribute struct {
	ID               string              `json:"id"`
	SamplingRelevant OptBool             `json:"sampling_relevant"`
	Type             AttributeType       `json:"type"`
	Brief            OptString           `json:"brief"`
	Note             OptString           `json:"note"`
	Tag              OptString           `json:"tag"`
	Examples         OptExamples         `json:"examples"`
	RequirementLevel OptRequirementLevel `json:"requirement_level"`
	Stability        OptString           `json:"stability"`
}

Ref: #/$defs/attribute

func (*Attribute) Decode

func (s *Attribute) Decode(d *jx.Decoder) error

Decode decodes Attribute from json.

func (*Attribute) Encode

func (s *Attribute) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Attribute) GetBrief

func (s *Attribute) GetBrief() OptString

GetBrief returns the value of Brief.

func (*Attribute) GetExamples

func (s *Attribute) GetExamples() OptExamples

GetExamples returns the value of Examples.

func (*Attribute) GetID

func (s *Attribute) GetID() string

GetID returns the value of ID.

func (*Attribute) GetNote

func (s *Attribute) GetNote() OptString

GetNote returns the value of Note.

func (*Attribute) GetRequirementLevel

func (s *Attribute) GetRequirementLevel() OptRequirementLevel

GetRequirementLevel returns the value of RequirementLevel.

func (*Attribute) GetSamplingRelevant

func (s *Attribute) GetSamplingRelevant() OptBool

GetSamplingRelevant returns the value of SamplingRelevant.

func (*Attribute) GetStability

func (s *Attribute) GetStability() OptString

GetStability returns the value of Stability.

func (*Attribute) GetTag

func (s *Attribute) GetTag() OptString

GetTag returns the value of Tag.

func (*Attribute) GetType

func (s *Attribute) GetType() AttributeType

GetType returns the value of Type.

func (*Attribute) MarshalJSON

func (s *Attribute) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Attribute) SetBrief

func (s *Attribute) SetBrief(val OptString)

SetBrief sets the value of Brief.

func (*Attribute) SetExamples

func (s *Attribute) SetExamples(val OptExamples)

SetExamples sets the value of Examples.

func (*Attribute) SetID

func (s *Attribute) SetID(val string)

SetID sets the value of ID.

func (*Attribute) SetNote

func (s *Attribute) SetNote(val OptString)

SetNote sets the value of Note.

func (*Attribute) SetRequirementLevel

func (s *Attribute) SetRequirementLevel(val OptRequirementLevel)

SetRequirementLevel sets the value of RequirementLevel.

func (*Attribute) SetSamplingRelevant

func (s *Attribute) SetSamplingRelevant(val OptBool)

SetSamplingRelevant sets the value of SamplingRelevant.

func (*Attribute) SetStability

func (s *Attribute) SetStability(val OptString)

SetStability sets the value of Stability.

func (*Attribute) SetTag

func (s *Attribute) SetTag(val OptString)

SetTag sets the value of Tag.

func (*Attribute) SetType

func (s *Attribute) SetType(val AttributeType)

SetType sets the value of Type.

func (*Attribute) UnmarshalJSON

func (s *Attribute) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Attribute) Validate

func (s *Attribute) Validate() error

type AttributeColumn

type AttributeColumn struct {
	Key    string
	Name   string
	Column AppendableColumn
}

AttributeColumn is a column with a normalized name.

type AttributeInfo

type AttributeInfo struct {
	Name string // col.name
	Type proto.ColumnType
}

AttributeInfo describes a column.

type AttributeReference

type AttributeReference struct {
	Ref              string              `json:"ref"`
	Brief            OptString           `json:"brief"`
	Note             OptString           `json:"note"`
	Tag              OptString           `json:"tag"`
	Examples         OptExamples         `json:"examples"`
	RequirementLevel OptRequirementLevel `json:"requirement_level"`
	SamplingRelevant OptBool             `json:"sampling_relevant"`
}

Ref: #/$defs/attributeReference

func (*AttributeReference) Decode

func (s *AttributeReference) Decode(d *jx.Decoder) error

Decode decodes AttributeReference from json.

func (*AttributeReference) Encode

func (s *AttributeReference) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AttributeReference) GetBrief

func (s *AttributeReference) GetBrief() OptString

GetBrief returns the value of Brief.

func (*AttributeReference) GetExamples

func (s *AttributeReference) GetExamples() OptExamples

GetExamples returns the value of Examples.

func (*AttributeReference) GetNote

func (s *AttributeReference) GetNote() OptString

GetNote returns the value of Note.

func (*AttributeReference) GetRef

func (s *AttributeReference) GetRef() string

GetRef returns the value of Ref.

func (*AttributeReference) GetRequirementLevel

func (s *AttributeReference) GetRequirementLevel() OptRequirementLevel

GetRequirementLevel returns the value of RequirementLevel.

func (*AttributeReference) GetSamplingRelevant

func (s *AttributeReference) GetSamplingRelevant() OptBool

GetSamplingRelevant returns the value of SamplingRelevant.

func (*AttributeReference) GetTag

func (s *AttributeReference) GetTag() OptString

GetTag returns the value of Tag.

func (*AttributeReference) MarshalJSON

func (s *AttributeReference) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AttributeReference) SetBrief

func (s *AttributeReference) SetBrief(val OptString)

SetBrief sets the value of Brief.

func (*AttributeReference) SetExamples

func (s *AttributeReference) SetExamples(val OptExamples)

SetExamples sets the value of Examples.

func (*AttributeReference) SetNote

func (s *AttributeReference) SetNote(val OptString)

SetNote sets the value of Note.

func (*AttributeReference) SetRef

func (s *AttributeReference) SetRef(val string)

SetRef sets the value of Ref.

func (*AttributeReference) SetRequirementLevel

func (s *AttributeReference) SetRequirementLevel(val OptRequirementLevel)

SetRequirementLevel sets the value of RequirementLevel.

func (*AttributeReference) SetSamplingRelevant

func (s *AttributeReference) SetSamplingRelevant(val OptBool)

SetSamplingRelevant sets the value of SamplingRelevant.

func (*AttributeReference) SetTag

func (s *AttributeReference) SetTag(val OptString)

SetTag sets the value of Tag.

func (*AttributeReference) UnmarshalJSON

func (s *AttributeReference) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeReference) Validate

func (s *AttributeReference) Validate() error

type AttributeType

type AttributeType struct {
	Type   AttributeTypeType // switch on this field
	Enum   Enum
	String string
}

AttributeType represents sum type.

func NewEnumAttributeType

func NewEnumAttributeType(v Enum) AttributeType

NewEnumAttributeType returns new AttributeType from Enum.

func NewStringAttributeType

func NewStringAttributeType(v string) AttributeType

NewStringAttributeType returns new AttributeType from string.

func (*AttributeType) Decode

func (s *AttributeType) Decode(d *jx.Decoder) error

Decode decodes AttributeType from json.

func (AttributeType) Encode

func (s AttributeType) Encode(e *jx.Encoder)

Encode encodes AttributeType as json.

func (AttributeType) GetEnum

func (s AttributeType) GetEnum() (v Enum, ok bool)

GetEnum returns Enum and true boolean if AttributeType is Enum.

func (AttributeType) GetString

func (s AttributeType) GetString() (v string, ok bool)

GetString returns string and true boolean if AttributeType is string.

func (AttributeType) IsEnum

func (s AttributeType) IsEnum() bool

IsEnum reports whether AttributeType is Enum.

func (AttributeType) IsString

func (s AttributeType) IsString() bool

IsString reports whether AttributeType is string.

func (AttributeType) MarshalJSON

func (s AttributeType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AttributeType) SetEnum

func (s *AttributeType) SetEnum(v Enum)

SetEnum sets AttributeType to Enum.

func (*AttributeType) SetString

func (s *AttributeType) SetString(v string)

SetString sets AttributeType to string.

func (*AttributeType) UnmarshalJSON

func (s *AttributeType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (AttributeType) Validate

func (s AttributeType) Validate() error

type AttributeTypeType

type AttributeTypeType string

AttributeTypeType is oneOf type of AttributeType.

const (
	EnumAttributeType   AttributeTypeType = "Enum"
	StringAttributeType AttributeTypeType = "string"
)

Possible values for AttributeTypeType.

type Enum

type Enum struct {
	AllowCustomValues OptBool           `json:"allow_custom_values"`
	Members           []EnumMembersItem `json:"members"`
}

Ref: #/$defs/enum

func (*Enum) Decode

func (s *Enum) Decode(d *jx.Decoder) error

Decode decodes Enum from json.

func (*Enum) Encode

func (s *Enum) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Enum) GetAllowCustomValues

func (s *Enum) GetAllowCustomValues() OptBool

GetAllowCustomValues returns the value of AllowCustomValues.

func (*Enum) GetMembers

func (s *Enum) GetMembers() []EnumMembersItem

GetMembers returns the value of Members.

func (*Enum) MarshalJSON

func (s *Enum) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Enum) SetAllowCustomValues

func (s *Enum) SetAllowCustomValues(val OptBool)

SetAllowCustomValues sets the value of AllowCustomValues.

func (*Enum) SetMembers

func (s *Enum) SetMembers(val []EnumMembersItem)

SetMembers sets the value of Members.

func (*Enum) UnmarshalJSON

func (s *Enum) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Enum) Validate

func (s *Enum) Validate() error

type EnumMembersItem

type EnumMembersItem struct {
	ID    string               `json:"id"`
	Note  OptString            `json:"note"`
	Value EnumMembersItemValue `json:"value"`
	Brief OptString            `json:"brief"`
}

func (*EnumMembersItem) Decode

func (s *EnumMembersItem) Decode(d *jx.Decoder) error

Decode decodes EnumMembersItem from json.

func (*EnumMembersItem) Encode

func (s *EnumMembersItem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*EnumMembersItem) GetBrief

func (s *EnumMembersItem) GetBrief() OptString

GetBrief returns the value of Brief.

func (*EnumMembersItem) GetID

func (s *EnumMembersItem) GetID() string

GetID returns the value of ID.

func (*EnumMembersItem) GetNote

func (s *EnumMembersItem) GetNote() OptString

GetNote returns the value of Note.

func (*EnumMembersItem) GetValue

func (s *EnumMembersItem) GetValue() EnumMembersItemValue

GetValue returns the value of Value.

func (*EnumMembersItem) MarshalJSON

func (s *EnumMembersItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*EnumMembersItem) SetBrief

func (s *EnumMembersItem) SetBrief(val OptString)

SetBrief sets the value of Brief.

func (*EnumMembersItem) SetID

func (s *EnumMembersItem) SetID(val string)

SetID sets the value of ID.

func (*EnumMembersItem) SetNote

func (s *EnumMembersItem) SetNote(val OptString)

SetNote sets the value of Note.

func (*EnumMembersItem) SetValue

func (s *EnumMembersItem) SetValue(val EnumMembersItemValue)

SetValue sets the value of Value.

func (*EnumMembersItem) UnmarshalJSON

func (s *EnumMembersItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type EnumMembersItemValue

type EnumMembersItemValue struct {
	Type   EnumMembersItemValueType // switch on this field
	String string
	Int    int
}

EnumMembersItemValue represents sum type.

func NewIntEnumMembersItemValue

func NewIntEnumMembersItemValue(v int) EnumMembersItemValue

NewIntEnumMembersItemValue returns new EnumMembersItemValue from int.

func NewStringEnumMembersItemValue

func NewStringEnumMembersItemValue(v string) EnumMembersItemValue

NewStringEnumMembersItemValue returns new EnumMembersItemValue from string.

func (*EnumMembersItemValue) Decode

func (s *EnumMembersItemValue) Decode(d *jx.Decoder) error

Decode decodes EnumMembersItemValue from json.

func (EnumMembersItemValue) Encode

func (s EnumMembersItemValue) Encode(e *jx.Encoder)

Encode encodes EnumMembersItemValue as json.

func (EnumMembersItemValue) GetInt

func (s EnumMembersItemValue) GetInt() (v int, ok bool)

GetInt returns int and true boolean if EnumMembersItemValue is int.

func (EnumMembersItemValue) GetString

func (s EnumMembersItemValue) GetString() (v string, ok bool)

GetString returns string and true boolean if EnumMembersItemValue is string.

func (EnumMembersItemValue) IsInt

func (s EnumMembersItemValue) IsInt() bool

IsInt reports whether EnumMembersItemValue is int.

func (EnumMembersItemValue) IsString

func (s EnumMembersItemValue) IsString() bool

IsString reports whether EnumMembersItemValue is string.

func (EnumMembersItemValue) MarshalJSON

func (s EnumMembersItemValue) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*EnumMembersItemValue) SetInt

func (s *EnumMembersItemValue) SetInt(v int)

SetInt sets EnumMembersItemValue to int.

func (*EnumMembersItemValue) SetString

func (s *EnumMembersItemValue) SetString(v string)

SetString sets EnumMembersItemValue to string.

func (*EnumMembersItemValue) UnmarshalJSON

func (s *EnumMembersItemValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type EnumMembersItemValueType

type EnumMembersItemValueType string

EnumMembersItemValueType is oneOf type of EnumMembersItemValue.

const (
	StringEnumMembersItemValue EnumMembersItemValueType = "string"
	IntEnumMembersItemValue    EnumMembersItemValueType = "int"
)

Possible values for EnumMembersItemValueType.

type ExampleValue

type ExampleValue struct {
	Type    ExampleValueType // switch on this field
	String  string
	Float64 float64
	Bool    bool
}

Ref: #/$defs/exampleValue ExampleValue represents sum type.

func NewBoolExampleValue

func NewBoolExampleValue(v bool) ExampleValue

NewBoolExampleValue returns new ExampleValue from bool.

func NewFloat64ExampleValue

func NewFloat64ExampleValue(v float64) ExampleValue

NewFloat64ExampleValue returns new ExampleValue from float64.

func NewStringExampleValue

func NewStringExampleValue(v string) ExampleValue

NewStringExampleValue returns new ExampleValue from string.

func (*ExampleValue) Decode

func (s *ExampleValue) Decode(d *jx.Decoder) error

Decode decodes ExampleValue from json.

func (ExampleValue) Encode

func (s ExampleValue) Encode(e *jx.Encoder)

Encode encodes ExampleValue as json.

func (ExampleValue) GetBool

func (s ExampleValue) GetBool() (v bool, ok bool)

GetBool returns bool and true boolean if ExampleValue is bool.

func (ExampleValue) GetFloat64

func (s ExampleValue) GetFloat64() (v float64, ok bool)

GetFloat64 returns float64 and true boolean if ExampleValue is float64.

func (ExampleValue) GetString

func (s ExampleValue) GetString() (v string, ok bool)

GetString returns string and true boolean if ExampleValue is string.

func (ExampleValue) IsBool

func (s ExampleValue) IsBool() bool

IsBool reports whether ExampleValue is bool.

func (ExampleValue) IsFloat64

func (s ExampleValue) IsFloat64() bool

IsFloat64 reports whether ExampleValue is float64.

func (ExampleValue) IsString

func (s ExampleValue) IsString() bool

IsString reports whether ExampleValue is string.

func (ExampleValue) MarshalJSON

func (s ExampleValue) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ExampleValue) SetBool

func (s *ExampleValue) SetBool(v bool)

SetBool sets ExampleValue to bool.

func (*ExampleValue) SetFloat64

func (s *ExampleValue) SetFloat64(v float64)

SetFloat64 sets ExampleValue to float64.

func (*ExampleValue) SetString

func (s *ExampleValue) SetString(v string)

SetString sets ExampleValue to string.

func (*ExampleValue) UnmarshalJSON

func (s *ExampleValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ExampleValue) Validate

func (s ExampleValue) Validate() error

type ExampleValueType

type ExampleValueType string

ExampleValueType is oneOf type of ExampleValue.

const (
	StringExampleValue  ExampleValueType = "string"
	Float64ExampleValue ExampleValueType = "float64"
	BoolExampleValue    ExampleValueType = "bool"
)

Possible values for ExampleValueType.

type Examples

type Examples struct {
	Type              ExamplesType // switch on this field
	ExampleValueArray []ExampleValue
	ExampleValue      ExampleValue
}

Ref: #/$defs/examples Examples represents sum type.

func NewExampleValueArrayExamples

func NewExampleValueArrayExamples(v []ExampleValue) Examples

NewExampleValueArrayExamples returns new Examples from []ExampleValue.

func NewExampleValueExamples

func NewExampleValueExamples(v ExampleValue) Examples

NewExampleValueExamples returns new Examples from ExampleValue.

func (*Examples) Decode

func (s *Examples) Decode(d *jx.Decoder) error

Decode decodes Examples from json.

func (Examples) Encode

func (s Examples) Encode(e *jx.Encoder)

Encode encodes Examples as json.

func (Examples) GetExampleValue

func (s Examples) GetExampleValue() (v ExampleValue, ok bool)

GetExampleValue returns ExampleValue and true boolean if Examples is ExampleValue.

func (Examples) GetExampleValueArray

func (s Examples) GetExampleValueArray() (v []ExampleValue, ok bool)

GetExampleValueArray returns []ExampleValue and true boolean if Examples is []ExampleValue.

func (Examples) IsExampleValue

func (s Examples) IsExampleValue() bool

IsExampleValue reports whether Examples is ExampleValue.

func (Examples) IsExampleValueArray

func (s Examples) IsExampleValueArray() bool

IsExampleValueArray reports whether Examples is []ExampleValue.

func (Examples) MarshalJSON

func (s Examples) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Examples) SetExampleValue

func (s *Examples) SetExampleValue(v ExampleValue)

SetExampleValue sets Examples to ExampleValue.

func (*Examples) SetExampleValueArray

func (s *Examples) SetExampleValueArray(v []ExampleValue)

SetExampleValueArray sets Examples to []ExampleValue.

func (*Examples) UnmarshalJSON

func (s *Examples) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Examples) Validate

func (s Examples) Validate() error

type ExamplesType

type ExamplesType string

ExamplesType is oneOf type of Examples.

const (
	ExampleValueArrayExamples ExamplesType = "[]ExampleValue"
	ExampleValueExamples      ExamplesType = "ExampleValue"
)

Possible values for ExamplesType.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode

func (o *OptBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptBool) Encode

func (o OptBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON

func (s OptBool) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON

func (s *OptBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptExamples

type OptExamples struct {
	Value Examples
	Set   bool
}

OptExamples is optional Examples.

func NewOptExamples

func NewOptExamples(v Examples) OptExamples

NewOptExamples returns new OptExamples with value set to v.

func (*OptExamples) Decode

func (o *OptExamples) Decode(d *jx.Decoder) error

Decode decodes Examples from json.

func (OptExamples) Encode

func (o OptExamples) Encode(e *jx.Encoder)

Encode encodes Examples as json.

func (OptExamples) Get

func (o OptExamples) Get() (v Examples, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptExamples) IsSet

func (o OptExamples) IsSet() bool

IsSet returns true if OptExamples was set.

func (OptExamples) MarshalJSON

func (s OptExamples) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptExamples) Or

func (o OptExamples) Or(d Examples) Examples

Or returns value if set, or given parameter if does not.

func (*OptExamples) Reset

func (o *OptExamples) Reset()

Reset unsets value.

func (*OptExamples) SetTo

func (o *OptExamples) SetTo(v Examples)

SetTo sets value to v.

func (*OptExamples) UnmarshalJSON

func (s *OptExamples) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptRequirementLevel

type OptRequirementLevel struct {
	Value RequirementLevel
	Set   bool
}

OptRequirementLevel is optional RequirementLevel.

func NewOptRequirementLevel

func NewOptRequirementLevel(v RequirementLevel) OptRequirementLevel

NewOptRequirementLevel returns new OptRequirementLevel with value set to v.

func (*OptRequirementLevel) Decode

func (o *OptRequirementLevel) Decode(d *jx.Decoder) error

Decode decodes RequirementLevel from json.

func (OptRequirementLevel) Encode

func (o OptRequirementLevel) Encode(e *jx.Encoder)

Encode encodes RequirementLevel as json.

func (OptRequirementLevel) Get

func (o OptRequirementLevel) Get() (v RequirementLevel, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptRequirementLevel) IsSet

func (o OptRequirementLevel) IsSet() bool

IsSet returns true if OptRequirementLevel was set.

func (OptRequirementLevel) MarshalJSON

func (s OptRequirementLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptRequirementLevel) Or

Or returns value if set, or given parameter if does not.

func (*OptRequirementLevel) Reset

func (o *OptRequirementLevel) Reset()

Reset unsets value.

func (*OptRequirementLevel) SetTo

SetTo sets value to v.

func (*OptRequirementLevel) UnmarshalJSON

func (s *OptRequirementLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RequirementLevel

type RequirementLevel struct {
	Type              RequirementLevelType // switch on this field
	String            string
	RequirementLevel1 RequirementLevel1
}

Ref: #/$defs/requirementLevel RequirementLevel represents sum type.

func NewRequirementLevel1RequirementLevel

func NewRequirementLevel1RequirementLevel(v RequirementLevel1) RequirementLevel

NewRequirementLevel1RequirementLevel returns new RequirementLevel from RequirementLevel1.

func NewStringRequirementLevel

func NewStringRequirementLevel(v string) RequirementLevel

NewStringRequirementLevel returns new RequirementLevel from string.

func (*RequirementLevel) Decode

func (s *RequirementLevel) Decode(d *jx.Decoder) error

Decode decodes RequirementLevel from json.

func (RequirementLevel) Encode

func (s RequirementLevel) Encode(e *jx.Encoder)

Encode encodes RequirementLevel as json.

func (RequirementLevel) GetRequirementLevel1

func (s RequirementLevel) GetRequirementLevel1() (v RequirementLevel1, ok bool)

GetRequirementLevel1 returns RequirementLevel1 and true boolean if RequirementLevel is RequirementLevel1.

func (RequirementLevel) GetString

func (s RequirementLevel) GetString() (v string, ok bool)

GetString returns string and true boolean if RequirementLevel is string.

func (RequirementLevel) IsRequirementLevel1

func (s RequirementLevel) IsRequirementLevel1() bool

IsRequirementLevel1 reports whether RequirementLevel is RequirementLevel1.

func (RequirementLevel) IsString

func (s RequirementLevel) IsString() bool

IsString reports whether RequirementLevel is string.

func (RequirementLevel) MarshalJSON

func (s RequirementLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RequirementLevel) SetRequirementLevel1

func (s *RequirementLevel) SetRequirementLevel1(v RequirementLevel1)

SetRequirementLevel1 sets RequirementLevel to RequirementLevel1.

func (*RequirementLevel) SetString

func (s *RequirementLevel) SetString(v string)

SetString sets RequirementLevel to string.

func (*RequirementLevel) UnmarshalJSON

func (s *RequirementLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RequirementLevel1

type RequirementLevel1 map[string]string

func (*RequirementLevel1) Decode

func (s *RequirementLevel1) Decode(d *jx.Decoder) error

Decode decodes RequirementLevel1 from json.

func (RequirementLevel1) Encode

func (s RequirementLevel1) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (RequirementLevel1) MarshalJSON

func (s RequirementLevel1) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RequirementLevel1) UnmarshalJSON

func (s *RequirementLevel1) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RequirementLevelType

type RequirementLevelType string

RequirementLevelType is oneOf type of RequirementLevel.

const (
	StringRequirementLevel            RequirementLevelType = "string"
	RequirementLevel1RequirementLevel RequirementLevelType = "RequirementLevel1"
)

Possible values for RequirementLevelType.

type Table

type Table struct {

	// Raw json.
	Raw proto.ColStr
	// Columns normalized.
	Columns []AttributeColumn
	// contains filtered or unexported fields
}

Table is a table with normalized column names.

func NewTable

func NewTable(columns []AttributeInfo) *Table

NewTable creates a new table with normalized column names.

func (*Table) Append

func (t *Table) Append(attrs otelstorage.Attrs)

Append appends attributes to the table.

func (*Table) Input

func (t *Table) Input() proto.Input

Input returns input for a ClickHouse query.

func (*Table) Reset

func (t *Table) Reset()

Reset resets table columns.

type Type

type Type struct {
	Groups []TypeGroupsItem `json:"groups"`
}

func (*Type) Decode

func (s *Type) Decode(d *jx.Decoder) error

Decode decodes Type from json.

func (*Type) Encode

func (s *Type) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Type) GetGroups

func (s *Type) GetGroups() []TypeGroupsItem

GetGroups returns the value of Groups.

func (*Type) MarshalJSON

func (s *Type) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Type) SetGroups

func (s *Type) SetGroups(val []TypeGroupsItem)

SetGroups sets the value of Groups.

func (*Type) UnmarshalJSON

func (s *Type) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Type) Validate

func (s *Type) Validate() error

type TypeGroupsItem

type TypeGroupsItem struct {
	ID         string                         `json:"id"`
	Prefix     OptString                      `json:"prefix"`
	Type       TypeGroupsItemType             `json:"type"`
	Brief      OptString                      `json:"brief"`
	Note       OptString                      `json:"note"`
	Attributes []TypeGroupsItemAttributesItem `json:"attributes"`
}

func (*TypeGroupsItem) Decode

func (s *TypeGroupsItem) Decode(d *jx.Decoder) error

Decode decodes TypeGroupsItem from json.

func (*TypeGroupsItem) Encode

func (s *TypeGroupsItem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TypeGroupsItem) GetAttributes

func (s *TypeGroupsItem) GetAttributes() []TypeGroupsItemAttributesItem

GetAttributes returns the value of Attributes.

func (*TypeGroupsItem) GetBrief

func (s *TypeGroupsItem) GetBrief() OptString

GetBrief returns the value of Brief.

func (*TypeGroupsItem) GetID

func (s *TypeGroupsItem) GetID() string

GetID returns the value of ID.

func (*TypeGroupsItem) GetNote

func (s *TypeGroupsItem) GetNote() OptString

GetNote returns the value of Note.

func (*TypeGroupsItem) GetPrefix

func (s *TypeGroupsItem) GetPrefix() OptString

GetPrefix returns the value of Prefix.

func (*TypeGroupsItem) GetType

func (s *TypeGroupsItem) GetType() TypeGroupsItemType

GetType returns the value of Type.

func (*TypeGroupsItem) MarshalJSON

func (s *TypeGroupsItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TypeGroupsItem) SetAttributes

func (s *TypeGroupsItem) SetAttributes(val []TypeGroupsItemAttributesItem)

SetAttributes sets the value of Attributes.

func (*TypeGroupsItem) SetBrief

func (s *TypeGroupsItem) SetBrief(val OptString)

SetBrief sets the value of Brief.

func (*TypeGroupsItem) SetID

func (s *TypeGroupsItem) SetID(val string)

SetID sets the value of ID.

func (*TypeGroupsItem) SetNote

func (s *TypeGroupsItem) SetNote(val OptString)

SetNote sets the value of Note.

func (*TypeGroupsItem) SetPrefix

func (s *TypeGroupsItem) SetPrefix(val OptString)

SetPrefix sets the value of Prefix.

func (*TypeGroupsItem) SetType

func (s *TypeGroupsItem) SetType(val TypeGroupsItemType)

SetType sets the value of Type.

func (*TypeGroupsItem) UnmarshalJSON

func (s *TypeGroupsItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TypeGroupsItem) Validate

func (s *TypeGroupsItem) Validate() error

type TypeGroupsItemAttributesItem

type TypeGroupsItemAttributesItem struct {
	Type               TypeGroupsItemAttributesItemType // switch on this field
	AttributeReference AttributeReference
	Attribute          Attribute
}

TypeGroupsItemAttributesItem represents sum type.

func NewAttributeReferenceTypeGroupsItemAttributesItem

func NewAttributeReferenceTypeGroupsItemAttributesItem(v AttributeReference) TypeGroupsItemAttributesItem

NewAttributeReferenceTypeGroupsItemAttributesItem returns new TypeGroupsItemAttributesItem from AttributeReference.

func NewAttributeTypeGroupsItemAttributesItem

func NewAttributeTypeGroupsItemAttributesItem(v Attribute) TypeGroupsItemAttributesItem

NewAttributeTypeGroupsItemAttributesItem returns new TypeGroupsItemAttributesItem from Attribute.

func (*TypeGroupsItemAttributesItem) Decode

Decode decodes TypeGroupsItemAttributesItem from json.

func (TypeGroupsItemAttributesItem) Encode

Encode encodes TypeGroupsItemAttributesItem as json.

func (TypeGroupsItemAttributesItem) GetAttribute

func (s TypeGroupsItemAttributesItem) GetAttribute() (v Attribute, ok bool)

GetAttribute returns Attribute and true boolean if TypeGroupsItemAttributesItem is Attribute.

func (TypeGroupsItemAttributesItem) GetAttributeReference

func (s TypeGroupsItemAttributesItem) GetAttributeReference() (v AttributeReference, ok bool)

GetAttributeReference returns AttributeReference and true boolean if TypeGroupsItemAttributesItem is AttributeReference.

func (TypeGroupsItemAttributesItem) IsAttribute

func (s TypeGroupsItemAttributesItem) IsAttribute() bool

IsAttribute reports whether TypeGroupsItemAttributesItem is Attribute.

func (TypeGroupsItemAttributesItem) IsAttributeReference

func (s TypeGroupsItemAttributesItem) IsAttributeReference() bool

IsAttributeReference reports whether TypeGroupsItemAttributesItem is AttributeReference.

func (TypeGroupsItemAttributesItem) MarshalJSON

func (s TypeGroupsItemAttributesItem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TypeGroupsItemAttributesItem) SetAttribute

func (s *TypeGroupsItemAttributesItem) SetAttribute(v Attribute)

SetAttribute sets TypeGroupsItemAttributesItem to Attribute.

func (*TypeGroupsItemAttributesItem) SetAttributeReference

func (s *TypeGroupsItemAttributesItem) SetAttributeReference(v AttributeReference)

SetAttributeReference sets TypeGroupsItemAttributesItem to AttributeReference.

func (*TypeGroupsItemAttributesItem) UnmarshalJSON

func (s *TypeGroupsItemAttributesItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (TypeGroupsItemAttributesItem) Validate

func (s TypeGroupsItemAttributesItem) Validate() error

type TypeGroupsItemAttributesItemType

type TypeGroupsItemAttributesItemType string

TypeGroupsItemAttributesItemType is oneOf type of TypeGroupsItemAttributesItem.

const (
	AttributeReferenceTypeGroupsItemAttributesItem TypeGroupsItemAttributesItemType = "AttributeReference"
	AttributeTypeGroupsItemAttributesItem          TypeGroupsItemAttributesItemType = "Attribute"
)

Possible values for TypeGroupsItemAttributesItemType.

type TypeGroupsItemType

type TypeGroupsItemType string
const (
	TypeGroupsItemTypeMetric         TypeGroupsItemType = "metric"
	TypeGroupsItemTypeSpan           TypeGroupsItemType = "span"
	TypeGroupsItemTypeResource       TypeGroupsItemType = "resource"
	TypeGroupsItemTypeAttributeGroup TypeGroupsItemType = "attribute_group"
)

func (TypeGroupsItemType) AllValues

func (TypeGroupsItemType) AllValues() []TypeGroupsItemType

AllValues returns all TypeGroupsItemType values.

func (*TypeGroupsItemType) Decode

func (s *TypeGroupsItemType) Decode(d *jx.Decoder) error

Decode decodes TypeGroupsItemType from json.

func (TypeGroupsItemType) Encode

func (s TypeGroupsItemType) Encode(e *jx.Encoder)

Encode encodes TypeGroupsItemType as json.

func (TypeGroupsItemType) MarshalJSON

func (s TypeGroupsItemType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (TypeGroupsItemType) MarshalText

func (s TypeGroupsItemType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*TypeGroupsItemType) UnmarshalJSON

func (s *TypeGroupsItemType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TypeGroupsItemType) UnmarshalText

func (s *TypeGroupsItemType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (TypeGroupsItemType) Validate

func (s TypeGroupsItemType) Validate() error

type TypedColumn

type TypedColumn[T any] struct {
	proto.ColumnOf[T]
	Append func(col proto.ColumnOf[T], v pcommon.Value)
}

TypedColumn is a column that can append values of a given type.

func (*TypedColumn[T]) AppendAttribute

func (t *TypedColumn[T]) AppendAttribute(v pcommon.Value)

AppendAttribute appends an attribute to the column.

func (*TypedColumn[T]) AppendZero

func (t *TypedColumn[T]) AppendZero()

AppendZero appends a zero value to the column.

Jump to

Keyboard shortcuts

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