MCPcopy Create free account
hub / github.com/baidu-golang/pbrpc / getServiceMethod

Function getServiceMethod

httpserver.go:202–211  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

200}
201
202func getServiceMethod(path string) (string, string, error) {
203 p := strings.TrimPrefix(path, HttpRpcPath)
204 p = strings.TrimSuffix(p, "/")
205
206 seperate := strings.Split(p, "/")
207 if len(seperate) != 2 {
208 return "", "", fmt.Errorf("no service or method found by path='%s'", p)
209 }
210 return seperate[0], seperate[1], nil
211}
212
213// UnescapeUnicode
214func UnescapeUnicode(raw []byte) ([]byte, error) {

Callers 1

ServeHTTPMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected