GetMethod returns the effective JSON-RPC method name to use on the wire. It strips the grpc_ prefix convention and preserves transport suffixes.
(fallback string)
| 218 | // GetMethod returns the effective JSON-RPC method name to use on the wire. |
| 219 | // It strips the grpc_ prefix convention and preserves transport suffixes. |
| 220 | func (r Request) GetMethod(fallback string) string { |
| 221 | base := r.Method |
| 222 | if base == "" { |
| 223 | base = fallback |
| 224 | } |
| 225 | info, err := ParseMethod(base) |
| 226 | if err != nil { |
| 227 | return base |
| 228 | } |
| 229 | return info.Name() |
| 230 | } |
| 231 | |
| 232 | // getMapKeys returns sorted keys from a map[string]bool |
| 233 | func getMapKeys(m map[string]bool) []string { |
no test coverage detected