fix again
This commit is contained in:
parent
2340b47a31
commit
3ee4eb5928
4 changed files with 8 additions and 6 deletions
|
|
@ -3,3 +3,5 @@
|
||||||
#### Improvements 🧹
|
#### Improvements 🧹
|
||||||
|
|
||||||
#### Bugfixes ⛑️
|
#### Bugfixes ⛑️
|
||||||
|
|
||||||
|
- Fix executable plugins that implement standalone router [#1910](https://github.com/terrastruct/d2/pull/1910)
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue