Documentation
¶
Index ¶
- Variables
- func ExtractTraceSubscriber(ctx context.Context, tracer trace.Tracer, traceId string, spanId string, ...) (rCtx context.Context, span trace.Span)
- type GooglePubSubClient
- type GooglePublishResult
- type GoogleSubscription
- type GoogleTopic
- type ListenHandler
- type Provider
- func (s *Provider) CreateClient() error
- func (s *Provider) CreateSubscription(name, topic, pushEndpoint, serverDns, subscription, prefixEndpoint string) error
- func (s *Provider) Publish(ctx context.Context, topic string, message []byte) error
- func (s *Provider) StartListen(handlers []ListenHandler) error
- func (s *Provider) StopListen() error
- func (s *Provider) Validate() error
- type ProviderConfig
- type PubSubClient
- type PublishResult
- type Subscription
- type Topic
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderLogger = logger.HcLog().Named("raiden.pubsub.google")
Functions ¶
Types ¶
type GooglePubSubClient ¶
func (*GooglePubSubClient) Close ¶
func (g *GooglePubSubClient) Close() error
func (*GooglePubSubClient) CreateSubscription ¶
func (g *GooglePubSubClient) CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (Subscription, error)
func (*GooglePubSubClient) Subscription ¶
func (g *GooglePubSubClient) Subscription(id string) Subscription
func (*GooglePubSubClient) Topic ¶
func (g *GooglePubSubClient) Topic(id string) Topic
type GooglePublishResult ¶
type GooglePublishResult struct {
// contains filtered or unexported fields
}
type GoogleSubscription ¶
type GoogleSubscription struct {
// contains filtered or unexported fields
}
func (*GoogleSubscription) ID ¶
func (g *GoogleSubscription) ID() string
type GoogleTopic ¶
type GoogleTopic struct {
// contains filtered or unexported fields
}
func (*GoogleTopic) GetInstance ¶
func (g *GoogleTopic) GetInstance() *pubsub.Topic
func (*GoogleTopic) Publish ¶
func (g *GoogleTopic) Publish(ctx context.Context, msg *pubsub.Message) PublishResult
type ListenHandler ¶
type ListenHandler struct {
Name string
Subscription string
AutoAck bool
ConsumeFn func(ctx context.Context, span trace.Span, msg any) error
}
ListenHandler describes a pull-subscription handler for StartListen.
type Provider ¶
type Provider struct {
Config *ProviderConfig
Client PubSubClient
Tracer trace.Tracer
}
Provider implements Google Cloud Pub/Sub operations.
func (*Provider) CreateClient ¶
func (*Provider) CreateSubscription ¶
func (*Provider) StartListen ¶
func (s *Provider) StartListen(handlers []ListenHandler) error
func (*Provider) StopListen ¶
type ProviderConfig ¶
ProviderConfig holds Google-specific configuration.
type PubSubClient ¶
type PubSubClient interface {
CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (Subscription, error)
Subscription(id string) Subscription
Topic(id string) Topic
Close() error
}
PubSubClient defines the methods required for Pub/Sub client interaction.
type PublishResult ¶
PublishResult abstracts the result of publishing a message.
Click to show internal directories.
Click to hide internal directories.