mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-09 13:24:52 +02:00
36-add-route-path-into-route-object
Added the route path into the route object so that we can see what meshes packets are routed across.
This commit is contained in:
@ -3,6 +3,7 @@ package query
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/jmespath/go-jmespath"
|
||||
"github.com/tim-beatham/wgmesh/pkg/conf"
|
||||
@ -27,6 +28,7 @@ type QueryError struct {
|
||||
type QueryRoute struct {
|
||||
Destination string `json:"destination"`
|
||||
HopCount int `json:"hopCount"`
|
||||
Path string `json:"path"`
|
||||
}
|
||||
|
||||
type QueryNode struct {
|
||||
@ -87,6 +89,7 @@ func MeshNodeToQueryNode(node mesh.MeshNode) *QueryNode {
|
||||
return QueryRoute{
|
||||
Destination: r.GetDestination().String(),
|
||||
HopCount: r.GetHopCount(),
|
||||
Path: strings.Join(r.GetPath(), ","),
|
||||
}
|
||||
})
|
||||
queryNode.Description = node.GetDescription()
|
||||
|
Reference in New Issue
Block a user