Documentation
¶
Overview ¶
Package keyspace owns namespace syntax and typed key codecs shared by infrastructure features.
Index ¶
- Constants
- func ValidName(name string) bool
- type Codec
- func NewCodec[K any](encode func(K) (string, error)) Codec[K]
- func SignedKeys[K ~int | ~int8 | ~int16 | ~int32 | ~int64]() Codec[K]
- func StringKeys[K ~string]() Codec[K]
- func TextKeys[K encoding.TextMarshaler]() Codec[K]
- func UnsignedKeys[K ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr]() Codec[K]
- type Feature
- type Namespace
Constants ¶
const MaxKeyBytes = 4096
MaxKeyBytes bounds a logical key before hashing; features may impose a lower limit.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶
type Codec[K any] struct { // contains filtered or unexported fields }
Codec encodes one concrete key type. Callbacks must be deterministic, concurrency-safe and return different text for distinct semantic keys. The consuming feature validates key size and syntax before backend access.
func SignedKeys ¶
SignedKeys preserves exact signed integer keys, including named natural IDs.
func StringKeys ¶
StringKeys creates a codec that uses the string key directly.
func TextKeys ¶
func TextKeys[K encoding.TextMarshaler]() Codec[K]
TextKeys creates a codec that uses each key's MarshalText method.
func UnsignedKeys ¶
UnsignedKeys preserves the full uint64 range without a floating-point conversion.
type Feature ¶
type Feature string
Feature identifies the physical key family owned by a framework adapter.