Documentation
¶
Index ¶
- Constants
- func New(connOpt ConnectionOption, opts ...Option) easypubsub.Subscriber
- type ConnectionOption
- type Consume
- type Exchange
- type Option
- func WithConsume(consume *Consume) Option
- func WithExchange(exchange *Exchange) Option
- func WithLogger(logger easypubsub.Logger) Option
- func WithQosConfig(qosConfig *QosConfig) Option
- func WithQueue(queue *Queue) Option
- func WithQueueBinds(queueBinds ...*QueueBind) Option
- func WithReconnectBackoff(reconnectBackoff backoffutils.BackoffFunc) Option
- func WithRequeueOnNack(enable bool) Option
- func WithUnmarshalMsgFunc(unmarshalMsgFunc UnmarshalMsgFunc) Option
- type QosConfig
- type Queue
- type QueueBind
- type Subscriber
- type UnmarshalMsgFunc
Constants ¶
View Source
const ( NORMAL = 0 CLOSED = 1 )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(connOpt ConnectionOption, opts ...Option) easypubsub.Subscriber
Types ¶
type ConnectionOption ¶
type ConnectionOption func(o *connectionOptions)
func Connection ¶
func Connection(url string) ConnectionOption
func ConnectionWithConfig ¶
func ConnectionWithConfig(url string, amqpConfig *amqp.Config) ConnectionOption
func ConnectionWithTLS ¶
func ConnectionWithTLS(url string, tlsConfig *tls.Config) ConnectionOption
type Option ¶
type Option func(o *options)
func WithConsume ¶
func WithExchange ¶
func WithLogger ¶
func WithLogger(logger easypubsub.Logger) Option
func WithQosConfig ¶
func WithQueueBinds ¶
func WithReconnectBackoff ¶
func WithReconnectBackoff(reconnectBackoff backoffutils.BackoffFunc) Option
func WithRequeueOnNack ¶
func WithUnmarshalMsgFunc ¶
func WithUnmarshalMsgFunc(unmarshalMsgFunc UnmarshalMsgFunc) Option
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func (*Subscriber) Close ¶
func (sub *Subscriber) Close() error
func (*Subscriber) String ¶
func (sub *Subscriber) String() string
func (*Subscriber) Subscribe ¶
func (sub *Subscriber) Subscribe(ctx context.Context, topic string) (<-chan *easypubsub.Message, <-chan error)
type UnmarshalMsgFunc ¶
Click to show internal directories.
Click to hide internal directories.