encodingaspects

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Code generated by copy paste; DO NOT EDIT.

Package encodingaspects is the closed vocabulary of encoding hints (ADR-0182). Every aspect maps to a real storage-encoding capability of a target technology (codec chains, native types); intensity scales (light … ultra-heavy) are advisory effort levels the technology mapping interprets. Numbering is the wire format (segments in physical column names): append-only between migration windows, family-grouped as of v2.

Index

Constants

View Source
const EmptyAspectSet = AspectSet("")
View Source
const InvalidAspectEnumValueString = "<invalid AspectE>"

Variables

View Source
var ErrEmptySet = aspectcodec.ErrEmptySet
View Source
var ErrInvalidEncoding = aspectcodec.ErrInvalidEncoding
View Source
var Families = []aspectcodec.Family[AspectE]{
	{Name: "record-cardinality", Members: []AspectE{AspectIntraRecordLowCardinality, AspectInterRecordLowCardinality}, Exclusive: false},
	{Name: "general-compression", Members: []AspectE{AspectUltraLightGeneralCompression, AspectLightGeneralCompression, AspectHeavyGeneralCompression, AspectUltraHeavyGeneralCompression}, Exclusive: true},
	{Name: "delta-encoding", Members: []AspectE{AspectDeltaEncoding, AspectDoubleDeltaEncoding}, Exclusive: true},
	{Name: "slowly-changing-float", Members: []AspectE{AspectUltraLightSlowlyChangingFloat, AspectLightSlowlyChangingFloat, AspectHeavySlowlyChangingFloat, AspectUltraHeavySlowlyChangingFloat}, Exclusive: true},
	{Name: "bias-small-integer", Members: []AspectE{AspectLightBiasSmallInteger, AspectHeavyBiasSmallInteger}, Exclusive: true},
	{Name: "json-native", Members: []AspectE{AspectJsonScalar, AspectJsonArray, AspectJsonObject, AspectJson}, Exclusive: false},
	{Name: "cbor-native", Members: []AspectE{AspectCborScalar, AspectCborArray, AspectCborMap, AspectCbor}, Exclusive: false},
}

Families is the registry of aspect families (ADR-0182 SD3): documentation of record and the source for exclusivity validation and, later, DQL authoring diagnostics. Exclusive families admit at most one member per set.

View Source
var MaxAspectExcl = slices.Max(AllAspects) + 1
View Source
var PackageProps = packageprops.Props{
	WASMWASI:         packageprops.WASMCompiles,
	WASMJS:           packageprops.WASMCompiles,
	WASMFreestanding: packageprops.WASMCompiles,
}

PackageProps records this package's curated properties (ADR-0080). Seeded by `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.

Functions

func CheckFamilyExclusivity added in v0.0.20

func CheckFamilyExclusivity(set AspectSet) (err error)

CheckFamilyExclusivity rejects sets carrying more than one member of an exclusive family.

func ContainsAspect

func ContainsAspect(encoded AspectSet, target AspectE) (has bool)

func CountEncodedAspects

func CountEncodedAspects(encoded AspectSet) (n int, err error)

func IterateAspects

func IterateAspects(encoded AspectSet) iter.Seq2[int, AspectE]

Types

type AspectE

type AspectE uint8
const (
	AspectIntraRecordLowCardinality AspectE = 0
	AspectInterRecordLowCardinality AspectE = 1

	AspectUltraLightGeneralCompression AspectE = 2
	AspectLightGeneralCompression      AspectE = 3
	AspectHeavyGeneralCompression      AspectE = 4
	AspectUltraHeavyGeneralCompression AspectE = 5

	AspectDeltaEncoding       AspectE = 6
	AspectDoubleDeltaEncoding AspectE = 7

	AspectUltraLightSlowlyChangingFloat AspectE = 8
	AspectLightSlowlyChangingFloat      AspectE = 9
	AspectHeavySlowlyChangingFloat      AspectE = 10
	AspectUltraHeavySlowlyChangingFloat AspectE = 11

	AspectLightBiasSmallInteger AspectE = 12
	AspectHeavyBiasSmallInteger AspectE = 13

	AspectSparse AspectE = 14

	AspectJsonScalar AspectE = 15
	AspectJsonArray  AspectE = 16
	AspectJsonObject AspectE = 17
	AspectJson       AspectE = 18
	AspectCborScalar AspectE = 19
	AspectCborArray  AspectE = 20
	AspectCborMap    AspectE = 21
	AspectCbor       AspectE = 22
)

func DecodeAspects added in v0.0.20

func DecodeAspects(encoded AspectSet) (known []AspectE, unknownCount int, err error)

DecodeAspects splits a structurally valid segment into aspects known to this vocabulary and a count of unknown (too-new) indices; unknown elements never poison the known part.

func MaxEncodedAspect

func MaxEncodedAspect(encoded AspectSet) (aspect AspectE, err error)

func SanitizeFamilyExclusivity added in v0.0.20

func SanitizeFamilyExclusivity(aspects []AspectE) (out []AspectE)

SanitizeFamilyExclusivity drops all but the first-encountered member of each exclusive family; sample generators use it to produce valid sets.

func (AspectE) IsValid

func (inst AspectE) IsValid() bool

func (AspectE) String

func (inst AspectE) String() string

func (AspectE) Value

func (inst AspectE) Value() uint8

type AspectSet

type AspectSet string

func EncodeAspects

func EncodeAspects(aspects ...AspectE) (encoded AspectSet, err error)

func EncodeAspectsIgnoreInvalid

func EncodeAspectsIgnoreInvalid(aspects ...AspectE) (encoded AspectSet)

func EncodeAspectsMustValidate

func EncodeAspectsMustValidate(aspects ...AspectE) (encoded AspectSet)

func UnionAspects

func UnionAspects(asp1 AspectSet, asp2 AspectSet) (res AspectSet, err error)

func UnionAspectsIgnoreInvalid

func UnionAspectsIgnoreInvalid(asp1 AspectSet, asp2 AspectSet) (res AspectSet)

UnionAspectsIgnoreInvalid merges both sets; a structurally invalid side is dropped rather than failing the union.

func (AspectSet) Contains

func (inst AspectSet) Contains(target AspectE) (has bool)

func (AspectSet) CountEncodedAspects

func (inst AspectSet) CountEncodedAspects() (n int, err error)

func (AspectSet) DecodeAspects added in v0.0.20

func (inst AspectSet) DecodeAspects() (known []AspectE, unknownCount int, err error)

func (AspectSet) IsEmptySet

func (inst AspectSet) IsEmptySet() bool

func (AspectSet) IsValid

func (inst AspectSet) IsValid() bool

func (AspectSet) IterateAspects

func (inst AspectSet) IterateAspects() iter.Seq2[int, AspectE]

func (AspectSet) MaxEncodedAspect

func (inst AspectSet) MaxEncodedAspect() (aspect AspectE, err error)

func (AspectSet) String

func (inst AspectSet) String() string

func (AspectSet) UnionAspects

func (inst AspectSet) UnionAspects(asp2 AspectSet) (res AspectSet, err error)

func (AspectSet) UnionAspectsIgnoreInvalid

func (inst AspectSet) UnionAspectsIgnoreInvalid(asp2 AspectSet) (res AspectSet)

Jump to

Keyboard shortcuts

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