当前位置: 首页>>代码示例>>Golang>>正文


Golang system.UnifyInstructionForm类代码示例

本文整理汇总了Golang中github.com/pipeviz/pipeviz/types/system.UnifyInstructionForm的典型用法代码示例。如果您正苦于以下问题:Golang UnifyInstructionForm类的具体用法?Golang UnifyInstructionForm怎么用?Golang UnifyInstructionForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UnifyInstructionForm类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: commitUnify

func commitUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
	candidates := g.VerticesWith(q.Qbv(system.VType("commit"), "sha1", u.Vertex().Properties()["sha1"]))

	if len(candidates) > 0 { // there can be only one
		return candidates[0].ID
	}

	return 0
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:9,代码来源:commit.go

示例2: 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"])))
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:10,代码来源:process.go

示例3: envUnify

func envUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
	matches := g.VerticesWith(q.Qbv(system.VType("environment")))

	for _, e := range matches {
		if maputil.AnyMatch(e.Vertex.Properties, u.Vertex().Properties(), "hostname", "ipv4", "ipv6") {
			return e.ID
		}
	}

	return 0
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:11,代码来源:environment.go

示例4: pkgYumUnify

func pkgYumUnify(g system.CoreGraph, u system.UnifyInstructionForm) uint64 {
	props := u.Vertex().Properties()
	vtv := g.VerticesWith(q.Qbv(system.VType("pkg-yum"),
		"name", props["name"],
		"version", props["version"],
		"arch", props["arch"],
		"epoch", props["epoch"],
	))

	if len(vtv) > 0 {
		return vtv[0].ID
	}
	return 0
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:14,代码来源:pkg_yum.go

示例5: 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"])))
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:10,代码来源:dataset.go

示例6: 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
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:19,代码来源:dataset.go

示例7: 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)))
	}
}
开发者ID:sdboyer,项目名称:pipeviz,代码行数:22,代码来源:process.go


注:本文中的github.com/pipeviz/pipeviz/types/system.UnifyInstructionForm类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。