本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeLogsNoaaRepository.CloseStub方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeLogsNoaaRepository.CloseStub方法的具体用法?Golang FakeLogsNoaaRepository.CloseStub怎么用?Golang FakeLogsNoaaRepository.CloseStub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/cf/api/fakes.FakeLogsNoaaRepository
的用法示例。
在下文中一共展示了FakeLogsNoaaRepository.CloseStub方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
logRepo.TailNoaaLogsForStub = func(appGuid string, onConnect func(), onMessage func(*events.LogMessage)) error {
onConnect()
onMessage(testlogs.NewLogMessage("Before close", appGuid, LogMessageTypeStaging, time.Now()))
<-logRepoClosed
time.Sleep(50 * time.Millisecond)
onMessage(testlogs.NewLogMessage("After close 1", appGuid, LogMessageTypeStaging, time.Now()))
onMessage(testlogs.NewLogMessage("After close 2", appGuid, LogMessageTypeStaging, time.Now()))
return nil
}
logRepo.CloseStub = func() {
close(logRepoClosed)
}
defaultInstanceResponses = [][]models.AppInstanceFields{
[]models.AppInstanceFields{},
[]models.AppInstanceFields{},
[]models.AppInstanceFields{{State: models.InstanceDown}, {State: models.InstanceStarting}},
[]models.AppInstanceFields{{State: models.InstanceStarting}, {State: models.InstanceStarting}},
[]models.AppInstanceFields{{State: models.InstanceRunning}, {State: models.InstanceRunning}},
}
defaultInstanceErrorCodes = []string{errors.APP_NOT_STAGED, errors.APP_NOT_STAGED, "", "", ""}
ui, _, appInstancesRepo := startAppWithInstancesAndErrors(displayApp, defaultAppForStart, requirementsFactory)
Expect(appInstancesRepo.GetInstancesArgsForCall(0)).To(Equal("my-app-guid"))