fix again

This commit is contained in:
Alexander Wang 2024-04-15 22:10:50 -07:00
parent 2340b47a31
commit 3ee4eb5928
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
4 changed files with 8 additions and 6 deletions

View file

@ -3,3 +3,5 @@
#### Improvements 🧹 #### Improvements 🧹
#### Bugfixes ⛑️ #### Bugfixes ⛑️
- Fix executable plugins that implement standalone router [#1910](https://github.com/terrastruct/d2/pull/1910)

View file

@ -223,8 +223,8 @@ func (p *execPlugin) RouteEdges(ctx context.Context, g *d2graph.Graph, edges []*
} }
in := routeEdgesInput{ in := routeEdgesInput{
g: graphBytes, G: graphBytes,
gedges: graphBytes2, GEdges: graphBytes2,
} }
b, err := json.Marshal(in) b, err := json.Marshal(in)

View file

@ -86,8 +86,8 @@ type RoutingPlugin interface {
} }
type routeEdgesInput struct { type routeEdgesInput struct {
g []byte G []byte `json:"g"`
gedges []byte GEdges []byte `json:"gEdges"`
} }
// PluginInfo is the current info information of a plugin. // PluginInfo is the current info information of a plugin.

View file

@ -157,12 +157,12 @@ func routeEdges(ctx context.Context, p RoutingPlugin, ms *xmain.State) error {
} }
var g d2graph.Graph var g d2graph.Graph
if err := d2graph.DeserializeGraph(in.g, &g); err != nil { if err := d2graph.DeserializeGraph(in.G, &g); err != nil {
return fmt.Errorf("failed to unmarshal input graph to graph: %s", in) return fmt.Errorf("failed to unmarshal input graph to graph: %s", in)
} }
var gedges d2graph.Graph var gedges d2graph.Graph
if err := d2graph.DeserializeGraph(in.gedges, &gedges); err != nil { if err := d2graph.DeserializeGraph(in.GEdges, &gedges); err != nil {
return fmt.Errorf("failed to unmarshal input edges graph to graph: %s", in) return fmt.Errorf("failed to unmarshal input edges graph to graph: %s", in)
} }