Documentation ¶
Index ¶
- func ActiveSign(active bool) string
- func CleanConnection(connection *redisConnection) error
- func CleanQueue(queue *redisQueue)
- func OpenConnection(tag, network, address string, db int) *redisConnection
- func OpenConnectionWithRedisClient(tag string, redisClient *redis.Client) *redisConnection
- type BatchConsumer
- type Cleaner
- type Connection
- type ConnectionStat
- type ConnectionStats
- type Consumer
- type ConsumerFunc
- type Deliveries
- type Delivery
- type Queue
- type QueueStat
- type QueueStats
- type RedisClient
- type RedisWrapper
- func (wrapper RedisWrapper) Del(key string) (affected int, ok bool)
- func (wrapper RedisWrapper) FlushDb()
- func (wrapper RedisWrapper) LLen(key string) (affected int, ok bool)
- func (wrapper RedisWrapper) LPush(key string, value ...string) bool
- func (wrapper RedisWrapper) LRem(key string, count int, value string) (affected int, ok bool)
- func (wrapper RedisWrapper) LTrim(key string, start, stop int)
- func (wrapper RedisWrapper) RPopLPush(source, destination string) (value string, ok bool)
- func (wrapper RedisWrapper) SAdd(key, value string) bool
- func (wrapper RedisWrapper) SMembers(key string) []string
- func (wrapper RedisWrapper) SRem(key, value string) (affected int, ok bool)
- func (wrapper RedisWrapper) Set(key string, value string, expiration time.Duration) bool
- func (wrapper RedisWrapper) TTL(key string) (ttl time.Duration, ok bool)
- type State
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveSign ¶
func CleanConnection ¶
func CleanConnection(connection *redisConnection) error
func CleanQueue ¶
func CleanQueue(queue *redisQueue)
func OpenConnection ¶
OpenConnection opens and returns a new connection
func OpenConnectionWithRedisClient ¶
func OpenConnectionWithRedisClient(tag string, redisClient *redis.Client) *redisConnection
OpenConnectionWithRedisClient opens and returns a new connection
Types ¶
type BatchConsumer ¶
type BatchConsumer interface {
Consume(batch Deliveries)
}
type Cleaner ¶
type Cleaner struct {
// contains filtered or unexported fields
}
func NewCleaner ¶
func NewCleaner(connection Connection) *Cleaner
type Connection ¶
type Connection interface { OpenQueue(name string) Queue CollectStats(queueList []string) Stats GetOpenQueues() []string }
Connection is an interface that can be used to test publishing
type ConnectionStat ¶
type ConnectionStat struct {
// contains filtered or unexported fields
}
func (ConnectionStat) String ¶
func (stat ConnectionStat) String() string
type ConnectionStats ¶
type ConnectionStats map[string]ConnectionStat
type ConsumerFunc ¶
type ConsumerFunc func(Delivery)
func (ConsumerFunc) Consume ¶
func (consumerFunc ConsumerFunc) Consume(delivery Delivery)
type Deliveries ¶
type Deliveries []Delivery
func (Deliveries) Ack ¶
func (deliveries Deliveries) Ack() int
func (Deliveries) Push ¶
func (deliveries Deliveries) Push() int
func (Deliveries) Reject ¶
func (deliveries Deliveries) Reject() int
type Queue ¶
type Queue interface { Publish(payload ...string) bool PublishBytes(payload ...[]byte) bool SetPushQueue(pushQueue Queue) StartConsuming(prefetchLimit int, pollDuration time.Duration) bool StopConsuming() <-chan struct{} AddConsumer(tag string, consumer Consumer) string AddConsumerFunc(tag string, consumerFunc ConsumerFunc) string AddBatchConsumer(tag string, batchSize int, consumer BatchConsumer) string AddBatchConsumerWithTimeout(tag string, batchSize int, timeout time.Duration, consumer BatchConsumer) string PurgeReady() int PurgeRejected() int ReturnRejected(count int) int ReturnAllRejected() int Close() bool ReadyCount() int UnackedCount() int RejectedCount() int }
type QueueStat ¶
type QueueStat struct { ReadyCount int `json:"ready"` RejectedCount int `json:"rejected"` // contains filtered or unexported fields }
func NewQueueStat ¶
func (QueueStat) ConnectionCount ¶
func (QueueStat) ConsumerCount ¶
func (QueueStat) UnackedCount ¶
type QueueStats ¶
type RedisClient ¶
type RedisClient interface { // simple keys Set(key string, value string, expiration time.Duration) bool Del(key string) (affected int, ok bool) // default affected: 0 TTL(key string) (ttl time.Duration, ok bool) // default ttl: 0 // lists LPush(key string, value ...string) bool LLen(key string) (affected int, ok bool) LRem(key string, count int, value string) (affected int, ok bool) LTrim(key string, start, stop int) RPopLPush(source, destination string) (value string, ok bool) // sets SAdd(key, value string) bool SMembers(key string) (members []string) // default members: []string{} SRem(key, value string) (affected int, ok bool) // default affected: 0 // special FlushDb() }
type RedisWrapper ¶
type RedisWrapper struct {
// contains filtered or unexported fields
}
func (RedisWrapper) FlushDb ¶
func (wrapper RedisWrapper) FlushDb()
func (RedisWrapper) LTrim ¶
func (wrapper RedisWrapper) LTrim(key string, start, stop int)
func (RedisWrapper) RPopLPush ¶
func (wrapper RedisWrapper) RPopLPush(source, destination string) (value string, ok bool)
func (RedisWrapper) SAdd ¶
func (wrapper RedisWrapper) SAdd(key, value string) bool
func (RedisWrapper) SMembers ¶
func (wrapper RedisWrapper) SMembers(key string) []string
func (RedisWrapper) SRem ¶
func (wrapper RedisWrapper) SRem(key, value string) (affected int, ok bool)
type Stats ¶
type Stats struct { QueueStats QueueStats `json:"queues"` // contains filtered or unexported fields }
func CollectStats ¶
Click to show internal directories.
Click to hide internal directories.