extractStatus extracts the status from the given blob and returns a map of status names to status values.
(blob []byte)
| 337 | |
| 338 | // extractStatus extracts the status from the given blob and returns a map of status names to status values. |
| 339 | func extractStatus(blob []byte) (map[string]string, errors.Error) { |
| 340 | var statusRes struct { |
| 341 | Data interface{} `json:"data"` |
| 342 | } |
| 343 | err := errors.Convert(json.Unmarshal(blob, &statusRes)) |
| 344 | if err != nil { |
| 345 | return nil, err |
| 346 | } |
| 347 | data, ok := statusRes.Data.(map[string]interface{}) |
| 348 | if !ok { |
| 349 | return nil, nil |
| 350 | } |
| 351 | results := make(map[string]string) |
| 352 | for k, v := range data { |
| 353 | if value, ok := v.(string); ok { |
| 354 | results[k] = value |
| 355 | } |
| 356 | } |
| 357 | return results, nil |
| 358 | } |
| 359 | |
| 360 | // getRepoNamespaceFromUrlPath |
| 361 | // returns the namespace of a repository from the given URL path, |