Documentation ¶
Index ¶
- func NewGooglePubSub(config *common_utils.BaseConfig) (c *pubsub.Client, err error)
- type GooglePubSub
- type PubSubClient
- type PubSubClientImpl
- func (p *PubSubClientImpl) CheckTopicAndPublish(ctx context.Context, topicsName []string, orderingKey string, data any)
- func (p *PubSubClientImpl) Close() error
- func (p *PubSubClientImpl) CreateSubscriptionIfNotExists(ctx context.Context, id string, topic *pubsub.Topic) (*pubsub.Subscription, error)
- func (p *PubSubClientImpl) CreateTopicIfNotExists(ctx context.Context, topicName string) (*pubsub.Topic, error)
- func (p *PubSubClientImpl) PublishTopics(ctx context.Context, topics []*pubsub.Topic, data any, orderingKey string) error
- func (p *PubSubClientImpl) PullMessages(ctx context.Context, id string, topic *pubsub.Topic, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGooglePubSub ¶
func NewGooglePubSub(config *common_utils.BaseConfig) (c *pubsub.Client, err error)
Types ¶
type GooglePubSub ¶
type GooglePubSub interface { CreateTopic(ctx context.Context, topicID string) (*pubsub.Topic, error) CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (*pubsub.Subscription, error) Topic(id string) *pubsub.Topic Subscription(id string) *pubsub.Subscription Close() error }
type PubSubClient ¶
type PubSubClient interface { CreateTopicIfNotExists(ctx context.Context, topicName string) (*pubsub.Topic, error) CreateSubscriptionIfNotExists(ctx context.Context, id string, topic *pubsub.Topic) (*pubsub.Subscription, error) PublishTopics(ctx context.Context, topics []*pubsub.Topic, data any, orderingKey string) error PullMessages(ctx context.Context, id string, topic *pubsub.Topic, callback func(ctx context.Context, msg *pubsub.Message)) error Close() error CheckTopicAndPublish(ctx context.Context, topicsName []string, orderingKey string, data any) }
func NewPubSubClient ¶
func NewPubSubClient(config *common_utils.BaseConfig, pubSub GooglePubSub) PubSubClient
type PubSubClientImpl ¶
type PubSubClientImpl struct {
// contains filtered or unexported fields
}
func (*PubSubClientImpl) CheckTopicAndPublish ¶
func (*PubSubClientImpl) Close ¶
func (p *PubSubClientImpl) Close() error
func (*PubSubClientImpl) CreateSubscriptionIfNotExists ¶
func (p *PubSubClientImpl) CreateSubscriptionIfNotExists(ctx context.Context, id string, topic *pubsub.Topic) (*pubsub.Subscription, error)
func (*PubSubClientImpl) CreateTopicIfNotExists ¶
func (*PubSubClientImpl) PublishTopics ¶
Click to show internal directories.
Click to hide internal directories.