本文整理汇总了Golang中github.com/cloudfoundry/noaa.Consumer.TailingLogs方法的典型用法代码示例。如果您正苦于以下问题:Golang Consumer.TailingLogs方法的具体用法?Golang Consumer.TailingLogs怎么用?Golang Consumer.TailingLogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/noaa.Consumer
的用法示例。
在下文中一共展示了Consumer.TailingLogs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
})
Describe("TailingLogs", func() {
var logMessageChan chan *events.LogMessage
var errorChan chan error
var doneChan chan struct{}
var stopChan chan struct{}
perform := func() {
connection = noaa.NewConsumer(trafficControllerUrl, tlsSettings, consumerProxyFunc)
logMessageChan = make(chan *events.LogMessage)
errorChan = make(chan error, 10)
stopChan = make(chan struct{})
doneChan = make(chan struct{})
go func() {
connection.TailingLogs(appGuid, authToken, logMessageChan, errorChan, stopChan)
close(doneChan)
}()
}
BeforeEach(func() {
startFakeTrafficController()
})
It("attempts to connect five times", func() {
fakeHandler.fail = true
perform()
fakeHandler.Close()
Eventually(errorChan, 3).Should(HaveLen(5))
示例2:
})
})
})
Describe("TailingLogs", func() {
var logMessageChan chan *events.LogMessage
var errorChan chan error
var doneChan chan struct{}
perform := func() {
cnsmr = noaa.NewConsumer(trafficControllerUrl, tlsSettings, consumerProxyFunc)
logMessageChan = make(chan *events.LogMessage)
errorChan = make(chan error, 10)
doneChan = make(chan struct{})
go func() {
cnsmr.TailingLogs(appGuid, authToken, logMessageChan, errorChan)
close(doneChan)
}()
}
BeforeEach(func() {
startFakeTrafficController()
})
It("attempts to connect five times", func() {
fakeHandler.fail = true
perform()
fakeHandler.Close()
Eventually(errorChan, 3).Should(HaveLen(5))