componentUserMetadata returns the user metadata stored on the given component, preferring a pending write staged in the current transaction.
(component Component)
| 1474 | // componentUserMetadata returns the user metadata stored on the given |
| 1475 | // component, preferring a pending write staged in the current transaction. |
| 1476 | func (n *Node) componentUserMetadata(component Component) *sdkpb.UserMetadata { |
| 1477 | if md, ok := n.pendingUserMetadata[component]; ok { |
| 1478 | return md |
| 1479 | } |
| 1480 | if refNode, ok := n.valueToNode[component]; ok && refNode.isComponent() { |
| 1481 | return refNode.serializedNode.GetMetadata().GetComponentAttributes().GetUserMetadata() |
| 1482 | } |
| 1483 | return nil |
| 1484 | } |
| 1485 | |
| 1486 | // setComponentUserMetadata stages a user-metadata write for the given component. |
| 1487 | // Applied during CloseTransaction. |
no test coverage detected