本文整理汇总了Golang中github.com/cloudfoundry/noaa.Consumer类的典型用法代码示例。如果您正苦于以下问题:Golang Consumer类的具体用法?Golang Consumer怎么用?Golang Consumer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Consumer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
noaa_errors "github.com/cloudfoundry/noaa/errors"
"github.com/cloudfoundry/noaa/events"
"github.com/gogo/protobuf/proto"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Noaa", func() {
var (
connection *noaa.Consumer
trafficControllerUrl string
testServer *httptest.Server
fakeHandler *FakeHandler
tlsSettings *tls.Config
consumerProxyFunc func(*http.Request) (*url.URL, error)
appGuid string
authToken string
messagesToSend chan []byte
err error
)
BeforeSuite(func() {
buf := &bytes.Buffer{}
log.SetOutput(buf)
})
BeforeEach(func() {
messagesToSend = make(chan []byte, 256)
})
示例2:
"github.com/cloudfoundry/noaa/events"
"github.com/elazarl/goproxy"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Noaa behind a Proxy", func() {
var (
connection *noaa.Consumer
endpoint string
testServer *httptest.Server
tlsSettings *tls.Config
consumerProxyFunc func(*http.Request) (*url.URL, error)
appGuid string
authToken string
incomingChan chan *events.Envelope
messagesToSend chan []byte
testProxyServer *httptest.Server
goProxyHandler *goproxy.ProxyHttpServer
err error
)
BeforeEach(func() {
messagesToSend = make(chan []byte, 256)
testServer = httptest.NewServer(handlers.NewWebsocketHandler(messagesToSend, 100*time.Millisecond, loggertesthelper.Logger()))
endpoint = "ws://" + testServer.Listener.Addr().String()
goProxyHandler = goproxy.NewProxyHttpServer()
goProxyHandler.Logger = log.New(bytes.NewBufferString(""), "", 0)
示例3:
noaa_errors "github.com/cloudfoundry/noaa/errors"
"github.com/cloudfoundry/sonde-go/events"
"github.com/gogo/protobuf/proto"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Noaa", func() {
var (
cnsmr *noaa.Consumer
trafficControllerUrl string
testServer *httptest.Server
fakeHandler *FakeHandler
tlsSettings *tls.Config
consumerProxyFunc func(*http.Request) (*url.URL, error)
appGuid string
authToken string
messagesToSend chan []byte
err error
)
BeforeSuite(func() {
buf := &bytes.Buffer{}
log.SetOutput(buf)
})
BeforeEach(func() {
messagesToSend = make(chan []byte, 256)
})