本文整理汇总了Golang中github.com/marmelab/gaudi/maestro.Maestro.Check方法的典型用法代码示例。如果您正苦于以下问题:Golang Maestro.Check方法的具体用法?Golang Maestro.Check怎么用?Golang Maestro.Check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/marmelab/gaudi/maestro.Maestro
的用法示例。
在下文中一共展示了Maestro.Check方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
flag.Parse()
m := maestro.Maestro{}
m.InitFromFile(retrieveConfigPath(*config))
if *check {
m.Check()
} else if *stop {
m.Stop()
} else {
m.Start()
}
}
示例2: TestCheckRunningContainerShouldUseDockerPs
func (s *MaestroTestSuite) TestCheckRunningContainerShouldUseDockerPs(c *C) {
// Create a gomock controller, and arrange for it's finish to be called
ctrl := gomock.NewController(c)
defer ctrl.Finish()
// Setup the docker mock package
docker.MOCK().SetController(ctrl)
// Setup the mockfmt mock package
mockfmt.MOCK().SetController(ctrl)
psResult := make(map[string]string)
psResult["gaudi/lb"] = "123"
psResult["gaudi/front1"] = "124"
psResult["gaudi/db"] = "125"
docker.EXPECT().SnapshotProcesses().Return(psResult, nil)
docker.EXPECT().Inspect("123").Return([]byte("[{\"ID\": \"123\", \"State\":{\"Running\": true}, \"NetworkSettings\": {\"IPAddress\": \"123.124.125.126\"}}]"), nil)
docker.EXPECT().Inspect("124").Return([]byte("[{\"ID\": \"123\", \"State\":{\"Running\": true}, \"NetworkSettings\": {\"IPAddress\": \"123.124.125.127\"}}]"), nil)
docker.EXPECT().Inspect("125").Return([]byte("[{\"ID\": \"123\", \"State\":{\"Running\": true}, \"NetworkSettings\": {\"IPAddress\": \"123.124.125.128\"}}]"), nil)
mockfmt.EXPECT().Println("Application", "lb", "is running", "(123.124.125.126:)")
mockfmt.EXPECT().Println("Application", "front1", "is running", "(123.124.125.127:)")
mockfmt.EXPECT().Println("Application", "db", "is running", "(123.124.125.128:3306)")
m := maestro.Maestro{}
m.InitFromString(`
applications:
lb:
links: [front1]
type: varnish
front1:
type: apache
db:
type: mysql
ports:
3306: 9000
`, "")
m.Check()
}