Documentation
¶
Overview ¶
Package enhancing allows for enhancement of model instances with your custom data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustUnwrap ¶
Retrieve the enhancement from `that` instance.
If `that` instance has not been enhanced yet, panic.
func Unwrap ¶
Retrieve the enhancement from `that` instance.
Return the enhancement, or `ok` false, if `that` instance has not been enhanced.
func Wrap ¶
func Wrap[E any]( that aastypes.IClass, factory func(aastypes.IClass) (E, bool), ) (result aastypes.IClass)
Wrap `that` instance recursively with the enhancement produced by the `factory`.
The factory returns the enhancement, and a boolean "should-enhance". If the "should-enhance" is false, `that` instance is not enhance, and we simply return it. However, we will still continue to enhance the instances referenced by `that` instance recursively.
If `that` instance has been already wrapped, panic.
Types ¶
This section is empty.