MCPcopy Create free account
hub / github.com/krau/SaveAny-Bot / extractTaskIDFromPath

Function extractTaskIDFromPath

api/handlers.go:180–186  ·  view source on GitHub ↗

extractTaskIDFromPath 从路径中提取任务 ID 路径格式: /api/v1/tasks/:id

(path string)

Source from the content-addressed store, hash-verified

178// extractTaskIDFromPath 从路径中提取任务 ID
179// 路径格式: /api/v1/tasks/:id
180func extractTaskIDFromPath(path string) string {
181 parts := strings.Split(strings.Trim(path, "/"), "/")
182 if len(parts) < 4 {
183 return ""
184 }
185 return parts[3]
186}
187
188// convertTaskProgressToResponse renders a task's current state, computing
189// percent and speed from the snapshot taken under the task's mutex.

Callers 3

TestEdgeCasesFunction · 0.85
GetTaskHandlerMethod · 0.85
CancelTaskHandlerMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestEdgeCasesFunction · 0.68