Versions in this module Expand all Collapse all v0 v0.0.1 Mar 6, 2020 Changes in this version + const QueueNotExist + func LoadQueues(rq *RQ) (err error) + func RedisKeyFromQueueID(qid QueueID) string + type CallByQueueID struct + func NewCallByQueueIDOperation(rq *RQ, f FuncWithQueueID) *CallByQueueID + func (opt *CallByQueueID) Operate(id QueueID) (result Result, err error) + type FuncWithQueueID func(QueueID) (Result, error) + type IdxQueue struct + Idx int + func NewIdxQueue(rq *RQ, qid QueueID, status QueueStatus, idx int) *IdxQueue + type Queue struct + ID QueueID + func NewQueue(rq *RQ, id QueueID, status QueueStatus) *Queue + func (queue *Queue) Clear() (result Result, err error) + func (queue *Queue) Dequeuing() int64 + func (queue *Queue) Get() (result Result, err error) + func (queue *Queue) Idle() bool + func (queue *Queue) Info() (result Result, err error) + func (queue *Queue) Put(request *Request) (Result, error) + func (queue *Queue) QueueSize() int64 + func (queue *Queue) Queuing() int64 + func (queue *Queue) SetStatus(status QueueStatus) (result Result, err error) + func (queue *Queue) Status() QueueStatus + func (queue *Queue) Sync(lock bool) (result Result, err error) + func (queue *Queue) View(start int64, end int64) (result Result, err error) + type QueueBox struct + func NewQueueBox(rq *RQ) *QueueBox + func (box *QueueBox) AddQueue(qid QueueID) (queue *IdxQueue, err error) + func (box *QueueBox) GetQueue(qid QueueID) (*IdxQueue, bool) + func (box *QueueBox) Info() (result Result) + func (box *QueueBox) OrderedQueues(k int64, start int64, status QueueStatus) Result + func (box *QueueBox) QueueNum(status QueueStatus) int + func (box *QueueBox) RandomQueues(k int64, status QueueStatus) Result + func (box *QueueBox) RemoveQueue(qid QueueID) error + func (box *QueueBox) UpdateQueueStatus(qid QueueID, status QueueStatus) (result Result, err error) + type QueueID struct + Host string + Port string + Scheme string + func CreateQueueID(host, port, scheme string) QueueID + func QueueIDFromRedisKey(key string) (qid QueueID, err error) + func QueueIDFromRequest(req *Request) QueueID + func (qid QueueID) MarshalJSON() ([]byte, error) + func (qid QueueID) String() string + type QueueNotExistError string + func (e QueueNotExistError) Error() string + type QueueOperation interface + Operate func(id QueueID) (Result, error) + type QueueStatus string + const QueueNilStatus + const QueuePaused + const QueueWorking + type RQ struct + Client *redis.Client + Conf *viper.Viper + Process *process.Process + func NewRQ(conf *viper.Viper, client *redis.Client) (rq *RQ, err error) + func (rq *RQ) AddRequest(rawReq *RawRequest) (result Result, err error) + func (rq *RQ) ClearQueue(qid QueueID) (Result, error) + func (rq *RQ) DeleteQueue(qid QueueID) (Result, error) + func (rq *RQ) ForceSyncQueue(qid QueueID) (result Result, err error) + func (rq *RQ) GetRequest(qid QueueID) (result Result, err error) + func (rq *RQ) Info() (result Result, err error) + func (rq *RQ) OrderedQueues(k int64, start int64, status QueueStatus) Result + func (rq *RQ) Pause() (Result, error) + func (rq *RQ) PauseQueue(qid QueueID) (result Result, err error) + func (rq *RQ) QueueInfo(qid QueueID) (Result, error) + func (rq *RQ) RandomQueues(k int64, status QueueStatus) Result + func (rq *RQ) Resume() (Result, error) + func (rq *RQ) ResumeQueue(qid QueueID) (result Result, err error) + func (rq *RQ) SyncQueue(qid QueueID) (result Result, err error) + func (rq *RQ) ViewQueue(qid QueueID, start int64, end int64) (result Result, err error) + type RQStats struct + func NewRQStats() *RQStats + func (rqStats *RQStats) IncrRequestNum(d int64) int64 + func (rqStats *RQStats) RequestNum() int64 + func (rqStats *RQStats) Stats() Result + func (rqStats *RQStats) UpdateInput(d int64) + func (rqStats *RQStats) UpdateOutput(d int64) + type RQStatus string + const RQPaused + const RQPreparing + const RQStopping + const RQWorking + type RawRequest struct + Body []byte + Cookies map[string]string + Encoding string + Headers map[string]string + Meta map[string]interface{} + Method string + URL string + type Request struct + RawReq *RawRequest + func NewRequest(rawReq *RawRequest) (request *Request, err error) + func (req *Request) JSON() ([]byte, error) + type Result map[string]interface + type UnavailableError string + func (e UnavailableError) Error() string + type ViewQueue struct + End int64 + R *RQ + Start int64 + func NewViewQueueOperation(rq *RQ, start, end int64) *ViewQueue + func (opt *ViewQueue) Operate(id QueueID) (Result, error)