@@ -68,10 +68,8 @@ func exampleCLIMain(_ string, root *expr.RootExpr, svr *expr.ServerExpr) *codege
68
68
"Root" : root ,
69
69
},
70
70
FuncMap : map [string ]any {
71
- "join" : strings .Join ,
72
- "toUpper" : strings .ToUpper ,
73
- "hasJSONRPC" : func () bool { return hasJSONRPCServices (root , svr ) },
74
- "hasHTTP" : func () bool { return hasHTTPServices (root , svr ) },
71
+ "join" : strings .Join ,
72
+ "toUpper" : strings .ToUpper ,
75
73
},
76
74
}, {
77
75
Name : "cli-main-end" ,
@@ -84,32 +82,10 @@ func exampleCLIMain(_ string, root *expr.RootExpr, svr *expr.ServerExpr) *codege
84
82
"Server" : svrdata ,
85
83
},
86
84
FuncMap : map [string ]any {
87
- "toUpper" : strings .ToUpper ,
88
- "join" : strings .Join ,
89
- "hasJSONRPC" : func () bool { return hasJSONRPCServices (root , svr ) },
90
- "hasHTTP" : func () bool { return hasHTTPServices (root , svr ) },
85
+ "toUpper" : strings .ToUpper ,
86
+ "join" : strings .Join ,
91
87
},
92
88
},
93
89
}
94
90
return & codegen.File {Path : path , SectionTemplates : sections , SkipExist : true }
95
91
}
96
-
97
- // hasJSONRPCServices checks if the given server has any JSON-RPC services.
98
- func hasJSONRPCServices (root * expr.RootExpr , svr * expr.ServerExpr ) bool {
99
- for _ , svcName := range svr .Services {
100
- if root .API .JSONRPC .Service (svcName ) != nil {
101
- return true
102
- }
103
- }
104
- return false
105
- }
106
-
107
- // hasHTTPServices checks if the given server has any HTTP services (not including JSON-RPC).
108
- func hasHTTPServices (root * expr.RootExpr , svr * expr.ServerExpr ) bool {
109
- for _ , svcName := range svr .Services {
110
- if root .API .HTTP .Service (svcName ) != nil {
111
- return true
112
- }
113
- }
114
- return false
115
- }
0 commit comments