(b []byte)
| 538 | } |
| 539 | |
| 540 | func nerdctlIDLabels(b []byte) (*string, *map[string]string) { |
| 541 | type idLabels struct { |
| 542 | ID *string `json:"nerdctlID,omitempty"` |
| 543 | Labels *map[string]string `json:"nerdctlLabels,omitempty"` |
| 544 | } |
| 545 | var idl idLabels |
| 546 | if err := json.Unmarshal(b, &idl); err != nil { |
| 547 | return nil, nil |
| 548 | } |
| 549 | return idl.ID, idl.Labels |
| 550 | } |
| 551 | |
| 552 | func networkID(name string) string { |
| 553 | hash := sha256.Sum256([]byte(name)) |