當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。