Documentation ¶
Index ¶
- Constants
- func ID() string
- func NewRedisPool(url, password string) *redis.Pool
- func RedisScan(conn redis.Conn, matched string) []string
- type Broker
- type Consumer
- type Message
- type Producer
- type RedisBroker
- func (b *RedisBroker) Ack(message *Message) error
- func (b *RedisBroker) Back(message *Message) error
- func (b *RedisBroker) BackFailed(topic string) []*Message
- func (b *RedisBroker) Bind(consumerId string)
- func (b *RedisBroker) Close()
- func (b *RedisBroker) GetBindConsumerId() string
- func (b *RedisBroker) Pop(topic string) (*Message, error)
- func (b *RedisBroker) Push(topic, content string) (*Message, error)
- func (b *RedisBroker) Ready(topic string, limit, offset int64) (*Result, error)
- func (b *RedisBroker) Stats() (*Stats, error)
- func (b *RedisBroker) Unack(topic string, limit, offset int64) (*Result, error)
- type RedisOptions
- type Result
- type Stats
Constants ¶
View Source
const ( Prefix = "nmq:" ReadyQueuePostfix = "ready" UnackQueuePostfix = "unack" HeartbeatPostfix = "heartbeat" )
Variables ¶
This section is empty.
Functions ¶
func NewRedisPool ¶
Types ¶
type Broker ¶
type Broker interface { GetBindConsumerId() string Bind(consumerId string) Close() Stats() (*Stats, error) Push(topic, content string) (*Message, error) Pop(topic string) (*Message, error) Ack(message *Message) error Back(message *Message) error Ready(topic string, limit, offset int64) (*Result, error) Unack(topic string, limit, offset int64) (*Result, error) BackFailed(topic string) []*Message }
func NewRedisBroker ¶
func NewRedisBroker(opt *RedisOptions) Broker
func NewRedisBrokerWithPool ¶
type Consumer ¶
func NewConsumer ¶
type RedisBroker ¶
type RedisBroker struct {
// contains filtered or unexported fields
}
func (*RedisBroker) Ack ¶
func (b *RedisBroker) Ack(message *Message) error
func (*RedisBroker) Back ¶
func (b *RedisBroker) Back(message *Message) error
func (*RedisBroker) BackFailed ¶
func (b *RedisBroker) BackFailed(topic string) []*Message
func (*RedisBroker) Bind ¶
func (b *RedisBroker) Bind(consumerId string)
func (*RedisBroker) Close ¶
func (b *RedisBroker) Close()
func (*RedisBroker) GetBindConsumerId ¶
func (b *RedisBroker) GetBindConsumerId() string
func (*RedisBroker) Ready ¶
func (b *RedisBroker) Ready(topic string, limit, offset int64) (*Result, error)
func (*RedisBroker) Stats ¶
func (b *RedisBroker) Stats() (*Stats, error)
type RedisOptions ¶
Click to show internal directories.
Click to hide internal directories.