splitOwnerModule splits an infoCache key of the form "owner/module" back into its parts. Returns ok=false if the key is malformed (no slash or empty parts). The owner part may itself contain a slash for some deploy topologies, so we split on the FIRST slash and treat the rest as module.
(key string)
| 1100 | // empty parts). The owner part may itself contain a slash for some deploy |
| 1101 | // topologies, so we split on the FIRST slash and treat the rest as module. |
| 1102 | func splitOwnerModule(key string) (owner, module string, ok bool) { |
| 1103 | idx := strings.IndexByte(key, '/') |
| 1104 | if idx <= 0 || idx == len(key)-1 { |
| 1105 | return "", "", false |
| 1106 | } |
| 1107 | return key[:idx], key[idx+1:], true |
| 1108 | } |
| 1109 | |
| 1110 | // ServeGetModules handles v1/v1beta1 ModuleService/GetModules. |
| 1111 | func (h *commitServiceHandler) ServeGetModules(w http.ResponseWriter, r *http.Request) { |
no outgoing calls
no test coverage detected