MCPcopy Create free account
hub / github.com/google/go-cloud / OpenTopic

Function OpenTopic

pubsub/rabbitpubsub/rabbit.go:206–208  ·  view source on GitHub ↗

OpenTopic returns a *pubsub.Topic corresponding to the named exchange. See the package documentation for an example. The exchange should already exist (for instance, by using amqp.Channel.ExchangeDeclare), although this won't be checked until the first call to SendBatch. For the Go CDK Pub/Sub mode

(conn *amqp.Connection, name string, opts *TopicOptions)

Source from the content-addressed store, hash-verified

204// The documentation of the amqp package recommends using separate connections for
205// publishing and subscribing.
206func OpenTopic(conn *amqp.Connection, name string, opts *TopicOptions) *pubsub.Topic {
207 return pubsub.NewTopic(newTopic(&connection{conn}, name, opts), nil)
208}
209
210func newTopic(conn amqpConnection, name string, opts *TopicOptions) *topic {
211 if opts == nil {

Callers 3

ExampleOpenTopicFunction · 0.92
TestOpensFunction · 0.70
OpenTopicURLMethod · 0.70

Calls 1

newTopicFunction · 0.70

Tested by 2

ExampleOpenTopicFunction · 0.74
TestOpensFunction · 0.56