Documentation ¶
Index ¶
- Constants
- func Get() pubsub.IPubSub
- func New(ctx context.Context, url string, options ...Option) (pubsub.IPubSub, error)
- func Set(ps pubsub.IPubSub)
- type Option
- type Redis
- func (r *Redis) Close() error
- func (r *Redis) GetClient() any
- func (r *Redis) MustPublish(ctx context.Context, msgs ...*message.Message) []*message.Message
- func (r *Redis) MustPublishAsync(ctx context.Context, messages ...*message.Message)
- func (r *Redis) MustSubscribe(ctx context.Context, subscriptions ...*subscription.Subscription) []*subscription.Subscription
- func (r *Redis) MustSubscribeAsync(ctx context.Context, subscriptions ...*subscription.Subscription)
- func (r *Redis) Publish(ctx context.Context, messages []*message.Message, opts ...pubsub.Func) ([]*message.Message, concurrentloop.Errors)
- func (r *Redis) Subscribe(ctx context.Context, subscriptions []*subscription.Subscription, ...) ([]*subscription.Subscription, concurrentloop.Errors)
- func (r *Redis) Unsubscribe(ctx context.Context, subscriptions ...*subscription.Subscription) error
Constants ¶
View Source
const Name = "redisgo"
Name is the name of the pubsub.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Redis ¶
type Redis struct { *pubsub.PubSub // Options are the Redis configuration. Options []Option `json:"-" validate:"required"` // Client is the Redis client. Client *redisgo.Client // URL is the Redis URL. URL string `json:"url" validate:"required"` // contains filtered or unexported fields }
Redis pubsub definition.
func (*Redis) GetClient ¶
GetClient returns the storage client. Use that to interact with the underlying storage client.
func (*Redis) MustPublish ¶
MustPublish sends a message to a topic. In case of error it will panic.
func (*Redis) MustPublishAsync ¶
MustPublishAsync sends a message to a topic asynchronously. In case of error it will panic.
func (*Redis) MustSubscribe ¶
func (r *Redis) MustSubscribe(ctx context.Context, subscriptions ...*subscription.Subscription) []*subscription.Subscription
MustSubscribe to a topic. In case of error it will panic.
func (*Redis) MustSubscribeAsync ¶
func (r *Redis) MustSubscribeAsync(ctx context.Context, subscriptions ...*subscription.Subscription)
MustSubscribeAsync to a topic asynchronously. In case of error it will panic.
func (*Redis) Publish ¶
func (r *Redis) Publish( ctx context.Context, messages []*message.Message, opts ...pubsub.Func, ) ([]*message.Message, concurrentloop.Errors)
Publish sends a message to a topic.
func (*Redis) Subscribe ¶
func (r *Redis) Subscribe( ctx context.Context, subscriptions []*subscription.Subscription, opts ...pubsub.Func, ) ([]*subscription.Subscription, concurrentloop.Errors)
Subscribe to a topic.
func (*Redis) Unsubscribe ¶
func (r *Redis) Unsubscribe(ctx context.Context, subscriptions ...*subscription.Subscription) error
Unsubscribe from a topic.
Click to show internal directories.
Click to hide internal directories.