Documentation
¶
Index ¶
- func ActiveSign(active bool) string
- 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 Deliveries
- type Delivery
- type Queue
- type QueueStat
- type QueueStats
- type State
- type Stats
- type TestBatchConsumer
- type TestConnection
- func (connection TestConnection) CollectStats(queueList []string) Stats
- func (connection TestConnection) GetDeliveries(queueName string) []string
- func (connection TestConnection) GetDelivery(queueName string, index int) string
- func (connection TestConnection) GetOpenQueues() []string
- func (connection TestConnection) OpenQueue(name string) Queue
- func (connection TestConnection) Reset()
- type TestConsumer
- type TestDelivery
- type TestQueue
- func (queue *TestQueue) AddBatchConsumer(tag string, batchSize int, consumer BatchConsumer) string
- func (queue *TestQueue) AddConsumer(tag string, consumer Consumer) string
- func (queue *TestQueue) Close() bool
- func (queue *TestQueue) Publish(payload string) bool
- func (queue *TestQueue) PublishBytes(payload []byte) bool
- func (queue *TestQueue) PurgeReady() bool
- func (queue *TestQueue) PurgeRejected() bool
- func (queue *TestQueue) ReceiveBatch(batchSize int, waitTime time.Duration) ([]Delivery, error)
- func (queue *TestQueue) Reset()
- func (queue *TestQueue) ReturnAllRejected() int
- func (queue *TestQueue) ReturnRejected(count int) int
- func (queue *TestQueue) SetPushQueue(pushQueue Queue)
- func (queue *TestQueue) StartConsuming(prefetchLimit int, pollDuration time.Duration) bool
- func (queue *TestQueue) StopConsuming() bool
- func (queue *TestQueue) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveSign ¶
func OpenConnection ¶
OpenConnection opens and returns a new connection
func OpenConnectionWithRedisClient ¶
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 *redisConnection) *Cleaner
func (*Cleaner) CleanConnection ¶
func (*Cleaner) CleanQueue ¶
func (cleaner *Cleaner) CleanQueue(queue *redisQueue)
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 Deliveries ¶
type Deliveries []Delivery
func (Deliveries) Ack ¶
func (deliveries Deliveries) Ack() 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() bool
AddConsumer(tag string, consumer Consumer) string
AddBatchConsumer(tag string, batchSize int, consumer BatchConsumer) string
PurgeReady() bool
PurgeRejected() bool
ReceiveBatch(batchSize int, waitTime time.Duration) ([]Delivery, error)
ReturnRejected(count int) int
ReturnAllRejected() int
Close() bool
}
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 Stats ¶
type Stats struct {
QueueStats QueueStats `json:"queues"`
// contains filtered or unexported fields
}
func CollectStats ¶
type TestBatchConsumer ¶
type TestBatchConsumer struct {
LastBatch Deliveries
// contains filtered or unexported fields
}
func NewTestBatchConsumer ¶
func NewTestBatchConsumer() *TestBatchConsumer
func (*TestBatchConsumer) Consume ¶
func (consumer *TestBatchConsumer) Consume(batch Deliveries)
func (*TestBatchConsumer) Finish ¶
func (consumer *TestBatchConsumer) Finish()
type TestConnection ¶
type TestConnection struct {
// contains filtered or unexported fields
}
func NewTestConnection ¶
func NewTestConnection() TestConnection
func (TestConnection) CollectStats ¶
func (connection TestConnection) CollectStats(queueList []string) Stats
func (TestConnection) GetDeliveries ¶
func (connection TestConnection) GetDeliveries(queueName string) []string
func (TestConnection) GetDelivery ¶
func (connection TestConnection) GetDelivery(queueName string, index int) string
func (TestConnection) GetOpenQueues ¶
func (connection TestConnection) GetOpenQueues() []string
func (TestConnection) OpenQueue ¶
func (connection TestConnection) OpenQueue(name string) Queue
func (TestConnection) Reset ¶
func (connection TestConnection) Reset()
type TestConsumer ¶
type TestConsumer struct {
AutoAck bool
AutoFinish bool
SleepDuration time.Duration
LastDelivery Delivery
LastDeliveries []Delivery
// contains filtered or unexported fields
}
func NewTestConsumer ¶
func NewTestConsumer(name string) *TestConsumer
func (*TestConsumer) Consume ¶
func (consumer *TestConsumer) Consume(delivery Delivery)
func (*TestConsumer) Finish ¶
func (consumer *TestConsumer) Finish()
func (*TestConsumer) String ¶
func (consumer *TestConsumer) String() string
type TestDelivery ¶
type TestDelivery struct {
State State
// contains filtered or unexported fields
}
func NewTestDelivery ¶
func NewTestDelivery(content interface{}) *TestDelivery
func NewTestDeliveryString ¶
func NewTestDeliveryString(payload string) *TestDelivery
func (*TestDelivery) Ack ¶
func (delivery *TestDelivery) Ack() bool
func (*TestDelivery) Payload ¶
func (delivery *TestDelivery) Payload() string
func (*TestDelivery) Push ¶
func (delivery *TestDelivery) Push() bool
func (*TestDelivery) Reject ¶
func (delivery *TestDelivery) Reject() bool
type TestQueue ¶
type TestQueue struct {
LastDeliveries []string
// contains filtered or unexported fields
}
func NewTestQueue ¶
func (*TestQueue) AddBatchConsumer ¶
func (queue *TestQueue) AddBatchConsumer(tag string, batchSize int, consumer BatchConsumer) string
func (*TestQueue) AddConsumer ¶
func (*TestQueue) PublishBytes ¶
func (*TestQueue) PurgeReady ¶
func (*TestQueue) PurgeRejected ¶
func (*TestQueue) ReceiveBatch ¶
func (*TestQueue) ReturnAllRejected ¶
func (*TestQueue) ReturnRejected ¶
func (*TestQueue) SetPushQueue ¶
func (*TestQueue) StartConsuming ¶
func (*TestQueue) StopConsuming ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
