本文整理汇总了Golang中metron/writers/dopplerforwarder.DopplerForwarder.Run方法的典型用法代码示例。如果您正苦于以下问题:Golang DopplerForwarder.Run方法的具体用法?Golang DopplerForwarder.Run怎么用?Golang DopplerForwarder.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类metron/writers/dopplerforwarder.DopplerForwarder
的用法示例。
在下文中一共展示了DopplerForwarder.Run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
BeforeEach(func() {
sender = fake.NewFakeMetricSender()
metrics.Initialize(sender, metricbatcher.New(sender, time.Millisecond*10))
client = &fakeclient.FakeClient{}
clientPool = &fakes.FakeClientPool{}
clientPool.RandomClientReturns(client, nil)
logger = loggertesthelper.Logger()
loggertesthelper.TestLoggerSink.Clear()
bufferSize = 10
forwarder = dopplerforwarder.New(clientPool, sharedSecret, bufferSize, logger)
doneChan = make(chan struct{})
go func() {
forwarder.Run()
close(doneChan)
}()
envelope = &events.Envelope{
Origin: proto.String("fake-origin-1"),
EventType: events.Envelope_LogMessage.Enum(),
LogMessage: factories.NewLogMessage(events.LogMessage_OUT, "message", "appid", "sourceType"),
}
})
AfterEach(func() {
forwarder.Stop()
<-doneChan
})
Context("client selection", func() {