本文整理匯總了Golang中github.com/burke/zeus/go/processtree.SlaveNode.State方法的典型用法代碼示例。如果您正苦於以下問題:Golang SlaveNode.State方法的具體用法?Golang SlaveNode.State怎麽用?Golang SlaveNode.State使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/burke/zeus/go/processtree.SlaveNode
的用法示例。
在下文中一共展示了SlaveNode.State方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: drawSubtree
func (s *StatusChart) drawSubtree(node *processtree.SlaveNode, myIndentation, childIndentation string) {
printStateInfo(myIndentation, node.Name, node.State(), false, true)
for i, slave := range node.Slaves {
if i == len(node.Slaves)-1 {
s.drawSubtree(slave, childIndentation+lineL, childIndentation+lineX)
} else {
s.drawSubtree(slave, childIndentation+lineT, childIndentation+lineI)
}
}
}
示例2: logSubtree
func (s *StatusChart) logSubtree(node *processtree.SlaveNode) {
log := theChart.directLogger
printStateInfo("", node.Name, node.State(), true, false)
if len(node.Slaves) > 0 {
log.ColorizedSansNl("{reset}(")
}
for i, slave := range node.Slaves {
if i != 0 {
log.ColorizedSansNl("{reset}, ")
}
s.logSubtree(slave)
}
if len(node.Slaves) > 0 {
log.ColorizedSansNl("{reset})")
}
}