Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrClosed = errors.New("pubsub: subscriber is closed")
)
var WireSet = wire.NewSet( ProvidePubSub, )
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface {
// Subscribe(ctx context.Context, topics ...string) error
// Publish(ctx context.Context, topics ...string) error
Close() error
}
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
type Option ¶
type Option interface {
Apply(*Config)
}
An Option configures a pubsub instance.
func WithHealthCheckInterval ¶
WithHealthCheckInterval specifies the config health check interval. PubSub will ping Server if it does not receive any messages within the interval (redis, ...). To disable health check, use zero interval.
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 interface {
Publisher
Subscriber
}
func ProvidePubSub ¶
func ProvidePubSub(config Config, client redis.UniversalClient) PubSub
type PublishConfig ¶
type PublishConfig struct {
// contains filtered or unexported fields
}
type PublishOption ¶
type PublishOption interface {
Apply(*PublishConfig)
}
func WithPublishNamespace ¶
func WithPublishNamespace(value string) PublishOption
WithPublishNamespace modifies publish config namespace.
type PublishOptionFunc ¶
type PublishOptionFunc func(*PublishConfig)
PublishOptionFunc is a function that configures a publish config.
func (PublishOptionFunc) Apply ¶
func (f PublishOptionFunc) Apply(config *PublishConfig)
Apply calls f(publishConfig).
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
type SubscribeConfig ¶
type SubscribeConfig struct {
// contains filtered or unexported fields
}
type SubscribeOption ¶
type SubscribeOption interface {
Apply(*SubscribeConfig)
}
func WithChannelNamespace ¶
func WithChannelNamespace(value string) SubscribeOption
WithNamespace returns an channel option that configures namespace.
type SubscribeOptionFunc ¶
type SubscribeOptionFunc func(*SubscribeConfig)
SubscribeOptionFunc is a function that configures a subscription config.
func (SubscribeOptionFunc) Apply ¶
func (f SubscribeOptionFunc) Apply(config *SubscribeConfig)
Apply calls f(subscribeConfig).