1
0
Fork 0

Adding upstream version 1.34.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-24 07:26:29 +02:00
parent e393c3af3f
commit 4978089aab
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
4963 changed files with 677545 additions and 0 deletions

View file

@ -0,0 +1,45 @@
package cloud_pubsub
import (
"context"
"cloud.google.com/go/pubsub"
)
type (
topic interface {
ID() string
Stop()
Publish(ctx context.Context, msg *pubsub.Message) publishResult
PublishSettings() pubsub.PublishSettings
SetPublishSettings(settings pubsub.PublishSettings)
}
publishResult interface {
Get(ctx context.Context) (string, error)
}
topicWrapper struct {
topic *pubsub.Topic
}
)
func (tw *topicWrapper) ID() string {
return tw.topic.ID()
}
func (tw *topicWrapper) Stop() {
tw.topic.Stop()
}
func (tw *topicWrapper) Publish(ctx context.Context, msg *pubsub.Message) publishResult {
return tw.topic.Publish(ctx, msg)
}
func (tw *topicWrapper) PublishSettings() pubsub.PublishSettings {
return tw.topic.PublishSettings
}
func (tw *topicWrapper) SetPublishSettings(settings pubsub.PublishSettings) {
tw.topic.PublishSettings = settings
}