()
| 72 | } |
| 73 | |
| 74 | func (e Edge) Encode() string { |
| 75 | s := []string{"(", e.Source.Alias, ")"} |
| 76 | |
| 77 | s = append(s, "-[") |
| 78 | |
| 79 | if e.Relation != "" { |
| 80 | s = append(s, ":", e.Relation) |
| 81 | } |
| 82 | |
| 83 | if len(e.Properties) > 0 { |
| 84 | p := make([]string, 0, len(e.Properties)) |
| 85 | for k, v := range e.Properties { |
| 86 | p = append(p, fmt.Sprintf("%s:%v", k, ToString(v))) |
| 87 | } |
| 88 | |
| 89 | s = append(s, "{") |
| 90 | s = append(s, strings.Join(p, ",")) |
| 91 | s = append(s, "}") |
| 92 | } |
| 93 | |
| 94 | s = append(s, "]->") |
| 95 | s = append(s, "(", e.Destination.Alias, ")") |
| 96 | |
| 97 | return strings.Join(s, "") |
| 98 | } |
nothing calls this directly
no test coverage detected