Documentation ¶
Index ¶
- func CountWebRequest() (int64, error)
- func DequeueRequests() ([]string, error)
- func Get(key string) (string, error)
- func GetRateLimitExpiration(key string) (time.Duration, error)
- func GetThrottleExpiration(key string) (time.Duration, error)
- func GetWebRequest(first bool) (reqID string, b []byte, err error)
- func LogRequest(v interface{}) error
- func LogWebRequest(reqID string, b []byte) error
- func New(queueProcessor, isDev bool, ex map[queue.TaskID]queue.TaskExecutor)
- func RateLimit(key string, expire time.Duration) (int64, error)
- func Set(key, value string) (string, error)
- func Throttle(key string, expire time.Duration) (int64, error)
- type Auth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountWebRequest ¶
CountWebRequest returns the number of failed web request pending for analysis.
func DequeueRequests ¶
DequeueRequests returns all pending requests ready to be inserted into the database.
func GetRateLimitExpiration ¶
GetRateLimitExpiration returns the duration before a key expire for rate limit.
func GetThrottleExpiration ¶
GetThrottleExpiration returns the duration before a key expire for throttling.
func GetWebRequest ¶
GetWebRequest returns the next web request logged from list.
func LogRequest ¶
func LogRequest(v interface{}) error
LogRequest adds a new item to the list of pending request to be logged.
func LogWebRequest ¶
LogWebRequest saves a web request for further analysis.
func New ¶
func New(queueProcessor, isDev bool, ex map[queue.TaskID]queue.TaskExecutor)
New initializes the queue service via the queue.New function.
The queueProcessor flag indicates if this instance will act as the Pub/Sub subscriber. There must be only one subscriber.
The ex parameter map[queue.TaskID]queue.Executor allow you to supply custom executors for your own custom task. A TaskExecutor must satisfy this interface.
type TaskExecutor interface { Run(t QueueTask) error }