Documentation ¶
Overview ¶
Package pubsub contains Pub/Sub client wrappers to be able to UT things.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Close see https://godoc.org/cloud.google.com/go/pubsub#Client.Close Close() error // Topic see https://godoc.org/cloud.google.com/go/pubsub#Client.Topic Topic(id string) Topic // Subscription see https://godoc.org/cloud.google.com/go/pubsub#Client.Subscription Subscription(id string) Subscription // CreateSubscription see https://godoc.org/cloud.google.com/go/pubsub#Client.CreateSubscription CreateSubscription(ctx context.Context, id string, cfg SubscriptionConfig) (Subscription, error) // CreateTopic see https://godoc.org/cloud.google.com/go/pubsub#Client.CreateTopic CreateTopic(ctx context.Context, id string) (Topic, error) // CreateTopicWithConfig see https://godoc.org/cloud.google.com/go/pubsub#Client.CreateTopicWithConfig CreateTopicWithConfig(ctx context.Context, id string, cfg *pubsub.TopicConfig) (Topic, error) }
Client matches the interface exposed by pubsub.Client see https://godoc.org/cloud.google.com/go/pubsub#Client
type CreateFn ¶
type CreateFn func(ctx context.Context, projectID string, opts ...option.ClientOption) (Client, error)
CreateFn is a factory function to create a Pub/Sub client.
type Subscription ¶
type Subscription interface { // Exists see https://godoc.org/cloud.google.com/go/pubsub#Subscription.Exists Exists(ctx context.Context) (bool, error) // Config see https://godoc.org/cloud.google.com/go/pubsub#Subscription.Config Config(ctx context.Context) (SubscriptionConfig, error) // Update see https://godoc.org/cloud.google.com/go/pubsub#Subscription.Update Update(ctx context.Context, cfg SubscriptionConfig) (SubscriptionConfig, error) // Delete see https://godoc.org/cloud.google.com/go/pubsub#Subscription.Delete Delete(ctx context.Context) error // ID see https://godoc.org/cloud.google.com/go/pubsub#Subscription.ID ID() string }
Subscription matches the interface exposed by pubsub.Subscription see https://godoc.org/cloud.google.com/go/pubsub#Subscription
type SubscriptionConfig ¶
type SubscriptionConfig struct { Topic Topic AckDeadline time.Duration RetainAckedMessages bool RetentionDuration time.Duration Labels map[string]string }
SubscriptionConfig re-implements pubsub.SubscriptionConfig to allow us to use a wrapped Topic internally.
type Topic ¶
type Topic interface { // Exists see https://godoc.org/cloud.google.com/go/pubsub#Topic.Exists Exists(ctx context.Context) (bool, error) // Delete see https://godoc.org/cloud.google.com/go/pubsub#Topic.Delete Delete(ctx context.Context) error // IAM see https://godoc.org/cloud.google.com/go/pubsub#Topic.IAM IAM() iam.Handle // ID see https://godoc.org/cloud.google.com/go/pubsub#Topic.ID ID() string // String see https://godoc.org/cloud.google.com/go/pubsub#Topic.String String() string }
Topic matches the interface exposed by pubsub.Topic see https://godoc.org/cloud.google.com/go/pubsub#Topic
Click to show internal directories.
Click to hide internal directories.