Extending nested node in tree #50
Answered
by
dhubler
sibuk-harabudjasim
asked this question in
Q&A
Replies: 1 comment 1 reply
-
#1 nest - you can
nodeutil.Node{} will nest automatically and in many ways diminishes
the need to use extend. In this example
https://github.com/freeconf/yang/blob/master/nodeutil/schema2.go
the same code OnGetChild func is called at each level until you decide
otherwise.
OnGetChild: ...
switch r.Meta.Ident {
// "target"can be 1 level or 10 levels deep
case "target"
// if you really want to use extend, you can do this
return &nodeutil.Extend{
Base: n.DoGetChild(r)
// custom code here
}
#2 . Implement "OnChoose" for choose. Link above has an example.
I need to update the examples to make this more obvious.
…On Fri, Dec 29, 2023 at 1:16 PM sibuk-harabudjasim ***@***.***> wrote:
https://freeconf.org/docs/examples/node-extend/ shows example of
extension of root node.
Is there a possibility to extend node few levels deep in node tree without
customizing each node along the way?
Even with custom nodes, is there an example of such extension?
More precise question:
How to define OnChoose for choice defined deeply in YANG tree?
—
Reply to this email directly, view it on GitHub
<#50>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7XWVBYP3UZQLTLPDFLYL4CI3AVCNFSM6AAAAABBG4NPAWVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGAYTCNBRGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sibuk-harabudjasim
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://freeconf.org/docs/examples/node-extend/ shows example of extension of root node.
Is there a possibility to extend node few levels deep in node tree without customizing each node along the way?
Even with custom nodes, is there an example of such extension?
More precise question:
How to define
OnChoose
for choice defined deeply in YANG tree?Beta Was this translation helpful? Give feedback.
All reactions