本文整理匯總了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()
}