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