Documentation
¶
Overview ¶
Package metadata owns the rules for resource metadata: string key and value pairs that Agents, Sessions and Vaults carry for their applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTooLarge = errors.New("metadata exceeds 64 KiB")
ErrTooLarge reports metadata whose JSON encoding exceeds 64 KiB.
Functions ¶
func Encode ¶
Encode returns the stored JSON object; nil metadata is stored as {}. It enforces only the 64 KiB storage bound, not Validate's rules.
func Validate ¶
Validate applies the pinned limits of 16 pairs, 64-character keys and 512-character values, then ValidateStorable. Keys are checked in sorted order, so the reported violation is stable.
func ValidateStorable ¶
ValidateStorable applies only the local U+0000 limit: PostgreSQL text and jsonb cannot store it, although the official service accepts it. Keys are checked in sorted order.
Types ¶
type Kind ¶
type Kind int
Kind names the rule a metadata map breaks.
const ( // TooManyPairs: more than 16 pairs; Length is the pair count. TooManyPairs Kind = iota + 1 // KeyTooLong: a key longer than 64 characters; Length is its length. KeyTooLong // ValueTooLong: a value longer than 512 characters; Length is its length. ValueTooLong // KeyUnstorable: a key contains U+0000. KeyUnstorable // ValueUnstorable: a value contains U+0000. ValueUnstorable )