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

Method OpenTopic

pubsub/pubsub.go:885–891  ·  view source on GitHub ↗

OpenTopic calls OpenTopicURL with the URL parsed from urlstr. OpenTopic is safe to call from multiple goroutines.

(ctx context.Context, urlstr string)

Source from the content-addressed store, hash-verified

883// OpenTopic calls OpenTopicURL with the URL parsed from urlstr.
884// OpenTopic is safe to call from multiple goroutines.
885func (mux *URLMux) OpenTopic(ctx context.Context, urlstr string) (*Topic, error) {
886 opener, u, err := mux.topicSchemes.FromString("Topic", urlstr)
887 if err != nil {
888 return nil, err
889 }
890 return opener.(TopicURLOpener).OpenTopicURL(ctx, u)
891}
892
893// OpenSubscription calls OpenSubscriptionURL with the URL parsed from urlstr.
894// OpenSubscription is safe to call from multiple goroutines.

Callers 2

TestURLMuxFunction · 0.80
OpenTopicFunction · 0.80

Calls 2

FromStringMethod · 0.80
OpenTopicURLMethod · 0.65

Tested by 1

TestURLMuxFunction · 0.64