MCPcopy Create free account
hub / github.com/araddon/qlbridge / FromPB

Method FromPB

expr/node.go:578–597  ·  view source on GitHub ↗
(n *NodePb)

Source from the content-addressed store, hash-verified

576 return &NodePb{Fn: n}
577}
578func (m *FuncNode) FromPB(n *NodePb) Node {
579
580 fn, ok := funcReg.FuncGet(strings.ToLower(n.Fn.Name))
581 if !ok {
582 u.Debugf("Not Found Func %q", n.Fn.Name)
583 // Panic?
584 }
585
586 f := FuncNode{
587 Name: n.Fn.Name,
588 Args: NodesFromNodesPb(n.Fn.Args),
589 F: fn,
590 }
591
592 if err := f.Validate(); err != nil {
593 u.Warnf("could not validate %v", err)
594 }
595
596 return &f
597}
598
599// Expr convert the FuncNode to Expr
600func (m *FuncNode) Expr() *Expr {

Callers 1

NodeFromNodePbFunction · 0.95

Calls 3

ValidateMethod · 0.95
NodesFromNodesPbFunction · 0.85
FuncGetMethod · 0.65

Tested by

no test coverage detected