AttribCheckEdge checks and converts attribute with name of layout edge
(b *Builder, am map[string]interface{}, fname string)
| 700 | |
| 701 | // AttribCheckEdge checks and converts attribute with name of layout edge |
| 702 | func AttribCheckEdge(b *Builder, am map[string]interface{}, fname string) error { |
| 703 | |
| 704 | v := am[fname] |
| 705 | if v == nil { |
| 706 | return nil |
| 707 | } |
| 708 | vs, ok := v.(string) |
| 709 | if !ok { |
| 710 | return b.err(am, fname, "Invalid edge name") |
| 711 | } |
| 712 | edge, ok := mapEdgeName[vs] |
| 713 | if !ok { |
| 714 | return b.err(am, fname, "Invalid edge name") |
| 715 | } |
| 716 | am[fname] = edge |
| 717 | return nil |
| 718 | } |
| 719 | |
| 720 | // AttribCheckLayout checks and converts layout attribute |
| 721 | func AttribCheckLayout(b *Builder, am map[string]interface{}, fname string) error { |