module documentation
Helpers for parsing and normalizing gRPC-style method identifiers.
| Exception | |
Raised when a method name does not match expected patterns. |
| Function | fix |
Normalize a fully-qualified gRPC method name to dotted form. |
| Function | service |
Extract the service name portion from a method identifier. |
| Variable | pattern |
Regular expression used to parse service and method components. |
Normalize a fully-qualified gRPC method name to dotted form.
gRPC method names are commonly expressed as /package.Service/Method. This helper strips the leading slash and replaces remaining slashes with dots, yielding package.Service.Method. If the name is already in a non-slashed format it is returned unchanged.
| Parameters | |
methodstr | Method name to normalize. |
| Returns | |
str | Dotted method identifier. |
Extract the service name portion from a method identifier.
Accepts gRPC-style method names separated by either / or . and returns the service portion. For example, both /pkg.Service/Method and pkg.Service.Method yield pkg.Service.
| Parameters | |
inputstr | Method name to parse. |
| Returns | |
str | Service identifier portion of the method name. |
| Raises | |
InvalidMethodNameError | If the name is malformed or the delimiter usage is inconsistent. |