Documentation
¶
Overview ¶
Package extensionrow validates persisted model-extension identities through the same typed owner descriptors that created them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adopt ¶
func Adopt(registry *extensions.Registry, owner extensions.OwnerName, row Identity, parts ...string) (extensions.Subject, bool, error)
Adopt verifies a row recorded under an earlier scope of its registered owner and returns the owner's current subject for it. The row's own key must match its recorded scope and subject key, and the stored key must round trip through the current codec to the same subject key; inconsistent rows fail closed. A row is adopted only when both its recorded scope and its identity's model name belong to models the owner declares (see Registry.DeclaresModel); any other row is reported as not declared (false) and left in place.
Types ¶
type Rows ¶
type Rows[M any, K comparable] struct { // contains filtered or unexported fields }
Rows validates persisted row identities: each row must belong to the owner's current scope, and its stored identity must derive its subject key and, with its parts such as a field and locale, its row key. A row whose stored identity is the canonical identity of the owner its subject key names needs no re-derivation, because that identity derived the key; any other row, such as one recorded under a declared storage model, is validated in full. Construction performs no I/O.
func For ¶
func For[M any, K comparable](owner extensions.Owner[M, K], references []model.Reference[M, K]) (Rows[M, K], error)
For prepares validation of rows read for references, a bounded batch.
func ForSubject ¶
func ForSubject[M any, K comparable](owner extensions.Owner[M, K], subject extensions.Subject) Rows[M, K]
ForSubject prepares validation of rows of one subject that owner derived, through Subject or Lock, such as the owner a write locked.
func Unknown ¶
func Unknown[M any, K comparable](owner extensions.Owner[M, K]) Rows[M, K]
Unknown prepares validation of rows whose owners are not known in advance, such as rows a search matched; each row is validated in full.