(w io.Writer, ops *pb.OpList, apimap *apiDefMap)
| 105 | } |
| 106 | |
| 107 | func generateFunctionsForOps(w io.Writer, ops *pb.OpList, apimap *apiDefMap) error { |
| 108 | thisPackage := reflect.TypeOf(tmplArgs{}).PkgPath() |
| 109 | if err := tmplHeader.Execute(w, thisPackage); err != nil { |
| 110 | return err |
| 111 | } |
| 112 | blacklist := map[string]bool{ |
| 113 | "Const": true, |
| 114 | "PyFunc": true, |
| 115 | "PyFuncStateless": true, |
| 116 | } |
| 117 | for _, op := range ops.Op { |
| 118 | if blacklist[op.Name] { |
| 119 | continue |
| 120 | } |
| 121 | apidef, err := apimap.Get(op.Name) |
| 122 | if err != nil { |
| 123 | return err |
| 124 | } |
| 125 | if err := generateFunctionForOp(w, op, apidef); err != nil { |
| 126 | return err |
| 127 | } |
| 128 | } |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | func generateFunctionForOp(w io.Writer, op *pb.OpDef, apidef *pb.ApiDef) error { |
| 133 | if strings.HasPrefix(op.Name, "_") { // Internal operation |
no test coverage detected