schema

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package schema holds shared data-schema primitives used by both the catalog reader and (eventually) code-generated clients. The canonical terms encoding in this file MUST remain byte-identical to pipeline/normalize/terms.py — their equality is asserted by testdata/terms_golden.jsonl which is consumed by both test suites.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalizeTerms

func CanonicalizeTerms(t Terms) string

CanonicalizeTerms returns the canonical JSON array encoding of Terms. Output: `["commitment","tenancy","os","support_tier","upfront","payment_option"]` with no whitespace, matching json.dumps(..., separators=(",", ":")) on the Python side.

func TermsHash

func TermsHash(t Terms) string

TermsHash returns the 128-bit hex digest (32 chars) of CanonicalizeTerms(t).

Types

type Kind

type Kind string

Kind enumerates the resource kinds understood by this binary. New kinds are appended per §5 and require a binary release; see spec §5 Kind taxonomy. M1 seed ships only LLM kinds because the only live shard is openrouter.

const (
	KindLLMText       Kind = "llm.text"
	KindLLMMultimodal Kind = "llm.multimodal"
	KindLLMEmbedding  Kind = "llm.embedding"
	KindLLMImage      Kind = "llm.image"
	KindLLMAudio      Kind = "llm.audio"
)

Supported Kind values.

func (Kind) IsLLM

func (k Kind) IsLLM() bool

IsLLM reports whether k is one of the llm.* kinds.

type Terms

type Terms struct {
	Commitment    string
	Tenancy       string
	OS            string
	SupportTier   string
	Upfront       string
	PaymentOption string
}

Terms is the six-tuple that participates in terms_hash. Field order in the JSON array is fixed (see CanonicalizeTerms) and a schema_version bump is required to change it.

Jump to

Keyboard shortcuts

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