lang: Move the Edge struct into the interfaces package

This makes it consumable from more than one package and avoids future
cycles.
This commit is contained in:
James Shubin
2022-11-11 20:28:22 -05:00
parent 76e0345609
commit 7c394bf735
3 changed files with 27 additions and 25 deletions

View File

@@ -18,6 +18,8 @@
package interfaces
import (
"strings"
"github.com/purpleidea/mgmt/engine"
"github.com/purpleidea/mgmt/lang/types"
)
@@ -187,3 +189,15 @@ type DataFunc interface {
// context.
SetData(*FuncData)
}
// FuncEdge links an output vertex (value) to an input vertex with a named
// argument.
type FuncEdge struct {
Args []string // list of named args that this edge sends to
}
// String displays the list of arguments this edge satisfies. It is a required
// property to be a valid pgraph.Edge.
func (obj *FuncEdge) String() string {
return strings.Join(obj.Args, ", ")
}