Documentation ¶
Overview ¶
Package pubsubx contains utilities for working with Google PubSub.
Index ¶
- func CleanupTopic(ctx context.Context, project, topic string)
- func EnsureSubscription(ctx context.Context, client *pubsub.Client, topic, id string) (*pubsub.Subscription, error)
- func EnsureTopic(ctx context.Context, client *pubsub.Client, topic string) (*pubsub.Topic, error)
- func MakeQualifiedSubscriptionName(project, subscription string) string
- func MakeQualifiedTopicName(project, topic string) string
- func Publish(ctx context.Context, project, topic string, messages ...string) (*pubsub.Subscription, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupTopic ¶
CleanupTopic deletes a topic with all subscriptions and logs any error. Useful for defer.
func EnsureSubscription ¶
func EnsureSubscription(ctx context.Context, client *pubsub.Client, topic, id string) (*pubsub.Subscription, error)
EnsureSubscription creates a new subscription with the given name, if it doesn't exist.
func EnsureTopic ¶
EnsureTopic creates a new topic, if it doesn't exist.
func MakeQualifiedSubscriptionName ¶
MakeQualifiedSubscriptionName returns a fully-qualified subscription name for the given project and subscription id.
func MakeQualifiedTopicName ¶
MakeQualifiedTopicName returns a fully-qualified topic name for the given project and topic.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.