NewAPIExpr initializes an API expression.
(name string, dsl func())
| 115 | |
| 116 | // NewAPIExpr initializes an API expression. |
| 117 | func NewAPIExpr(name string, dsl func()) *APIExpr { |
| 118 | return &APIExpr{ |
| 119 | Name: name, |
| 120 | HTTP: new(HTTPExpr), |
| 121 | GRPC: new(GRPCExpr), |
| 122 | JSONRPC: new(JSONRPCExpr), |
| 123 | DSLFunc: dsl, |
| 124 | ExampleGenerator: NewRandom(name), |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | // Schemes returns the list of transport schemes used by all the API servers. |
| 129 | // The possible values for the elements of the returned slice are "http", |