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:
@@ -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, ", ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user