Documentation
¶
Index ¶
- Variables
- type Config
- type Option
- type OptionFunc
- type PubSub
- func (r *PubSub) Close(_ context.Context) error
- func (ps *PubSub) Publish(ctx context.Context, topic string, payload []byte, ...) error
- func (ps *PubSub) Subscribe(ctx context.Context, topic string, handler func(payload *pubsub.Msg) error, ...) pubsub.Consumer
- func (ps *PubSub) SubscribeChan(ctx context.Context, topic string, options ...pubsub.SubscribeOption) (pubsub.Consumer, <-chan *pubsub.Msg)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrClosed = errors.New("pubsub: subscriber is closed")
)
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
Apply(*Config)
}
An Option configures a pubsub instance.
func WithNamespace ¶
WithNamespace returns an option that set config namespace.
func WithSendTimeout ¶
WithSendTimeout specifies the pubsub send timeout after which the message is dropped.
type OptionFunc ¶
type OptionFunc func(*Config)
OptionFunc is a function that configures a pubsub config.
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) Publish ¶
func (ps *PubSub) Publish(ctx context.Context, topic string, payload []byte, opts ...pubsub.PublishOption) error
Publish event to message broker with payload.
Click to show internal directories.
Click to hide internal directories.