Documentation ¶
Index ¶
- Constants
- func New(clientOpt ClientOption, opts ...Option) easypubsub.Subscriber
- type ChannelGenerator
- type ClientOption
- type MsgUnmarshaler
- type Option
- func WithChannelGenerator(generateChannel ChannelGenerator) Option
- func WithEnablePatternSubscribe() Option
- func WithLogger(logger easypubsub.Logger) Option
- func WithMsgUnmarshaler(unmarshalMsg MsgUnmarshaler) Option
- func WithNackResendBackoff(nackResendBackoff backoffutils.BackoffFunc) Option
- func WithNackResendMaxAttempt(nackResendMaxAttempt uint) Option
- func WithPatternGenerator(generatePattern PatternGenerator) Option
- func WithReSubBackoff(reSubBackoff backoffutils.BackoffFunc) Option
- func WithReSubMaxAttempt(reSubMaxAttempt uint) Option
- type PatternGenerator
- type Subscriber
Constants ¶
View Source
const ( NORMAL = 0 CLOSED = 1 )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(clientOpt ClientOption, opts ...Option) easypubsub.Subscriber
Types ¶
type ChannelGenerator ¶
type ClientOption ¶
type ClientOption func(o *clientOptions)
func ClusterClient ¶
func ClusterClient(opts *redis.ClusterOptions) ClientOption
func FailoverClient ¶
func FailoverClient(opts *redis.FailoverOptions) ClientOption
func SampleClient ¶
func SampleClient(opts *redis.Options) ClientOption
type MsgUnmarshaler ¶
type Option ¶
type Option func(o *options)
func WithChannelGenerator ¶
func WithChannelGenerator(generateChannel ChannelGenerator) Option
func WithEnablePatternSubscribe ¶
func WithEnablePatternSubscribe() Option
func WithLogger ¶
func WithLogger(logger easypubsub.Logger) Option
func WithMsgUnmarshaler ¶
func WithMsgUnmarshaler(unmarshalMsg MsgUnmarshaler) Option
func WithNackResendBackoff ¶
func WithNackResendBackoff(nackResendBackoff backoffutils.BackoffFunc) Option
func WithPatternGenerator ¶
func WithPatternGenerator(generatePattern PatternGenerator) Option
func WithReSubBackoff ¶
func WithReSubBackoff(reSubBackoff backoffutils.BackoffFunc) Option
func WithReSubMaxAttempt ¶
type PatternGenerator ¶
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)
Click to show internal directories.
Click to hide internal directories.