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

Method OpenSubscription

pubsub/pubsub.go:895–901  ·  view source on GitHub ↗

OpenSubscription calls OpenSubscriptionURL with the URL parsed from urlstr. OpenSubscription is safe to call from multiple goroutines.

(ctx context.Context, urlstr string)

Source from the content-addressed store, hash-verified

893// OpenSubscription calls OpenSubscriptionURL with the URL parsed from urlstr.
894// OpenSubscription is safe to call from multiple goroutines.
895func (mux *URLMux) OpenSubscription(ctx context.Context, urlstr string) (*Subscription, error) {
896 opener, u, err := mux.subscriptionSchemes.FromString("Subscription", urlstr)
897 if err != nil {
898 return nil, err
899 }
900 return opener.(SubscriptionURLOpener).OpenSubscriptionURL(ctx, u)
901}
902
903// OpenTopicURL dispatches the URL to the opener that is registered with the
904// URL's scheme. OpenTopicURL is safe to call from multiple goroutines.

Callers 2

TestURLMuxFunction · 0.80
OpenSubscriptionFunction · 0.80

Calls 2

FromStringMethod · 0.80
OpenSubscriptionURLMethod · 0.65

Tested by 1

TestURLMuxFunction · 0.64