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


Golang Report.Topology方法代码示例

本文整理汇总了Golang中github.com/weaveworks/scope/report.Report.Topology方法的典型用法代码示例。如果您正苦于以下问题:Golang Report.Topology方法的具体用法?Golang Report.Topology怎么用?Golang Report.Topology使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/weaveworks/scope/report.Report的用法示例。


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

示例1: NodeTables

// NodeTables produces a list of tables (to be consumed directly by the UI) based
// on the report and the node.  It uses the report to get the templates for the node's
// topology.
func NodeTables(r report.Report, n report.Node) []report.Table {
	if _, ok := n.Counters.Lookup(n.Topology); ok {
		// This is a group of nodes, so no tables!
		return nil
	}

	if topology, ok := r.Topology(n.Topology); ok {
		return topology.TableTemplates.Tables(n)
	}
	return nil
}
开发者ID:CNDonny,项目名称:scope,代码行数:14,代码来源:tables.go

示例2: NodeMetadata

// NodeMetadata produces a table (to be consumed directly by the UI) based on
// an a report.Node, which is (hopefully) a node in one of our topologies.
func NodeMetadata(r report.Report, n report.Node) []report.MetadataRow {
	if _, ok := n.Counters.Lookup(n.Topology); ok {
		// This is a group of nodes, so no metadata!
		return nil
	}

	if topology, ok := r.Topology(n.Topology); ok {
		return topology.MetadataTemplates.MetadataRows(n)
	}
	return nil
}
开发者ID:CNDonny,项目名称:scope,代码行数:13,代码来源:metadata.go

示例3: NodeMetrics

// NodeMetrics produces a table (to be consumed directly by the UI) based on
// an a report.Node, which is (hopefully) a node in one of our topologies.
func NodeMetrics(r report.Report, n report.Node) []report.MetricRow {
	if _, ok := n.Counters.Lookup(n.Topology); ok {
		// This is a group of nodes, so no metrics!
		return nil
	}

	topology, ok := r.Topology(n.Topology)
	if !ok {
		return nil
	}
	return topology.MetricTemplates.MetricRows(n)
}
开发者ID:CNDonny,项目名称:scope,代码行数:14,代码来源:metrics.go

示例4: Render

// Render implements Renderer
func (t TopologySelector) Render(r report.Report, _ Decorator) report.Nodes {
	topology, _ := r.Topology(string(t))
	return topology.Nodes
}
开发者ID:CNDonny,项目名称:scope,代码行数:5,代码来源:selectors.go

示例5: controls

func controls(r report.Report, n report.Node) []ControlInstance {
	if t, ok := r.Topology(n.Topology); ok {
		return controlsFor(t, n.ID)
	}
	return []ControlInstance{}
}
开发者ID:CNDonny,项目名称:scope,代码行数:6,代码来源:node.go


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