Documentation ¶
Index ¶
- type Client
- type Config
- type IRedis
- type PubSub
- func (p PubSub) AddSubscription(ctx context.Context, channel string, s broker.ISubscription) error
- func (p PubSub) Publish(ctx context.Context, request PublishRequest) error
- func (p PubSub) PublishBulk(ctx context.Context, publishRequest []PublishRequest) error
- func (p PubSub) RemoveSubscription(ctx context.Context, channel string, s broker.ISubscription) error
- func (p PubSub) Subscribe(ctx context.Context, channel ...string) broker.ISubscription
- func (p PubSub) UnSubscribe(ctx context.Context, s broker.ISubscription) error
- type PubSubSubscription
- type PublishRequest
- type StreamSubscription
- type Streams
- func (ss Streams) AddSubscription(ctx context.Context, channel string, s broker.ISubscription) error
- func (ss Streams) Publish(ctx context.Context, request PublishRequest) error
- func (ss Streams) PublishBulk(ctx context.Context, publishRequests []PublishRequest) error
- func (ss Streams) RemoveSubscription(ctx context.Context, channel string, s broker.ISubscription) error
- func (ss Streams) Subscribe(ctx context.Context, channel ...string) broker.ISubscription
- func (ss Streams) UnSubscribe(ctx context.Context, s broker.ISubscription) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds redis client
type IRedis ¶
type IRedis interface { Publish(ctx context.Context, publishRequest PublishRequest) error PublishBulk(ctx context.Context, publishRequest []PublishRequest) error Subscribe(ctx context.Context, channel ...string) broker.ISubscription UnSubscribe(ctx context.Context, s broker.ISubscription) error AddSubscription(ctx context.Context, channel string, s broker.ISubscription) error RemoveSubscription(ctx context.Context, channel string, s broker.ISubscription) error }
IRedis is an interface over redis pubusb and streams
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub provides redis pubsub implementation
func (PubSub) AddSubscription ¶
AddSubscription to a redis pubsub channel
func (PubSub) Publish ¶
func (p PubSub) Publish(ctx context.Context, request PublishRequest) error
Publish message to redis
func (PubSub) PublishBulk ¶
func (p PubSub) PublishBulk(ctx context.Context, publishRequest []PublishRequest) error
PublishBulk publishes messages in bulk
func (PubSub) RemoveSubscription ¶
func (p PubSub) RemoveSubscription(ctx context.Context, channel string, s broker.ISubscription) error
RemoveSubscription removes a subscription
func (PubSub) UnSubscribe ¶
UnSubscribe from all channels
type PubSubSubscription ¶
type PubSubSubscription struct { broker.BaseSubscription // contains filtered or unexported fields }
PubSubSubscription provides pubsub subscription
type PublishRequest ¶
PublishRequest is the publishRequest
type StreamSubscription ¶
type StreamSubscription struct { Streams broker.BaseSubscription }
StreamSubscription provides stream subscription
type Streams ¶
type Streams struct {
// contains filtered or unexported fields
}
Streams provide redis streams implementation
func (Streams) AddSubscription ¶
func (ss Streams) AddSubscription(ctx context.Context, channel string, s broker.ISubscription) error
AddSubscription ...
func (Streams) Publish ¶
func (ss Streams) Publish(ctx context.Context, request PublishRequest) error
Publish message to redis
func (Streams) PublishBulk ¶
func (ss Streams) PublishBulk(ctx context.Context, publishRequests []PublishRequest) error
PublishBulk publishes messages in bulk
func (Streams) RemoveSubscription ¶
func (ss Streams) RemoveSubscription(ctx context.Context, channel string, s broker.ISubscription) error
RemoveSubscription ...
func (Streams) UnSubscribe ¶
UnSubscribe ...
Click to show internal directories.
Click to hide internal directories.