Versions in this module Expand all Collapse all v0 v0.0.1 Nov 10, 2020 Changes in this version + var ErrPublisherDestroyed = errors.New("publisher instance was destroyed") + func NewPubsub(ctx context.Context, config Config, opts ...option.ClientOption) (pubsub.Pubsub, error) + type Config struct + Concurrency int + CredentialsPath string + ProjectID string + Timeout time.Duration + type Listener struct + func (l Listener) Listen(ctx context.Context) + func (l Listener) OnError() chan error + func (l Listener) OnMessage(envelop pubsub.Envelop, newMessage func() pubsub.Message) chan pubsub.Message + func (l Listener) OnUnmatched() chan pubsub.Message + func (l Listener) Stop() + type Publisher struct + func (p *Publisher) Destroy() + func (p *Publisher) Send(ctx context.Context, msg pubsub.Envelop) (pubsub.SendResults, error) + func (p *Publisher) To(topics ...string) pubsub.Publisher + func (p *Publisher) WithOption(opt interface{}) pubsub.Publisher + type Pubsub struct + Client *googlePubSub.Client + Config Config + func (p Pubsub) Listen(subscription string) pubsub.Listener + func (p Pubsub) Publish() pubsub.Publisher + func (p Pubsub) Receive(subscription string) pubsub.Receiver + func (p Pubsub) Registry() pubsub.Registry + type Receiver struct + func (r Receiver) OnError(callback func(ctx context.Context)) + func (r Receiver) OnMessage(envelop pubsub.Envelop, callback pubsub.MessageCallback) + func (r Receiver) OnUnmatched(callback pubsub.MessageCallback) + func (r Receiver) Receive(ctx context.Context) error + func (r Receiver) Start(ctx context.Context) + func (r Receiver) Stop() + type Registry struct + func (l *Registry) AddSubscription(key string, receiveSettings *googlePubSub.ReceiveSettings) error + func (l *Registry) AddTopic(key string, publishSettings *googlePubSub.PublishSettings) error + func (l *Registry) Clear() + func (l *Registry) MustAddSubscription(key string, receiveSettings *googlePubSub.ReceiveSettings) pubsub.Registry + func (l *Registry) MustAddTopic(key string, publishSettings *googlePubSub.PublishSettings) pubsub.Registry + func (l *Registry) StopTopic(key string) + func (l *Registry) StopTopics(topics ...string) + type SendResults struct + func (s SendResults) OnResults(ctx context.Context, callback func(topic string, result pubsub.Result)) + func (s SendResults) Results(ctx context.Context) pubsub.Results