本文整理匯總了Golang中github.com/pipeviz/pipeviz/types/system.UnifyInstructionForm.ScopingSpecs方法的典型用法代碼示例。如果您正苦於以下問題:Golang UnifyInstructionForm.ScopingSpecs方法的具體用法?Golang UnifyInstructionForm.ScopingSpecs怎麽用?Golang UnifyInstructionForm.ScopingSpecs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/pipeviz/pipeviz/types/system.UnifyInstructionForm
的用法示例。
在下文中一共展示了UnifyInstructionForm.ScopingSpecs方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: processUnify
func processUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
// only one scoping edge - the envlink
edge, success := u.ScopingSpecs()[0].(EnvLink).Resolve(g, 0, emptyVT(u.Vertex()))
if !success {
// FIXME scoping edge resolution failure does not mean no match - there could be an orphan
return 0
}
return findMatchingEnvId(g, edge, g.VerticesWith(q.Qbv(system.VType("process"), "pid", u.Vertex().Properties()["pid"])))
}
示例2: parentDatasetUnify
func parentDatasetUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
edge, success := u.ScopingSpecs()[0].(EnvLink).Resolve(g, 0, emptyVT(u.Vertex()))
if !success {
// FIXME scoping edge resolution failure does not mean no match - there could be an orphan
return 0
}
props := u.Vertex().Properties()
return findMatchingEnvId(g, edge, g.VerticesWith(q.Qbv(system.VType("parent-dataset"), "path", props["path"], "name", props["name"])))
}
示例3: datasetUnify
func datasetUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
vtv := g.VerticesWith(q.Qbv(system.VType("dataset"), "name", u.Vertex().Properties()["name"]))
if len(vtv) == 0 {
return 0
}
spec := u.ScopingSpecs()[0].(specDatasetHierarchy)
el, success := spec.Environment.Resolve(g, 0, emptyVT(u.Vertex()))
// FIXME scoping edge resolution failure does not mean no match - there could be an orphan
if success {
for _, vt := range vtv {
if id := findMatchingEnvId(g, el, g.SuccessorsWith(vt.ID, q.Qbe(system.EType("dataset-hierarchy")))); id != 0 {
return vt.ID
}
}
}
return 0
}
示例4: commUnify
func commUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
// only one scoping edge - the envlink
edge, success := u.ScopingSpecs()[0].(EnvLink).Resolve(g, 0, emptyVT(u.Vertex()))
if !success {
// FIXME scoping edge resolution failure does not mean no match - there could be an orphan
return 0
}
vp := u.Vertex().Properties()
typ, _ := vp["type"]
path, haspath := vp["path"]
if haspath {
return findMatchingEnvId(g, edge, g.VerticesWith(q.Qbv(system.VType("comm"),
"type", typ,
"path", path)))
} else {
port, _ := vp["port"]
return findMatchingEnvId(g, edge, g.VerticesWith(q.Qbv(system.VType("comm"),
"type", typ,
"port", port)))
}
}