delayjob

package
v0.0.0-...-7bf43a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RedisPool RedisPool连接池实例
	RedisPool *redis.Pool
)

Functions

func Init

func Init()

Init 初始化延时队列

func Push

func Push(value interface{}) error

Push 添加一个Job到队列中

Types

type BaseOrm

type BaseOrm struct {
	DB *gorm.DB
}

func (*BaseOrm) InitDB

func (that *BaseOrm) InitDB()

* 初始化数据库

type BucketItem

type BucketItem struct {
	// contains filtered or unexported fields
}

BucketItem bucket中的元素

type CloseOrder

type CloseOrder struct {
	Jobs
	Body CloseOrderBody `json:"body"`
}

* 关闭vip订单

type CloseOrderBody

type CloseOrderBody struct {
	OrderId string `json:"order_id"`
}

* 关闭vip订单具体操作

type Jobs

type Jobs struct {
	Topic string `json:"topic"`
	ID    string `json:"id"`    //job唯一标识ID
	Delay int64  `json:"delay"` //延迟时间, unix时间戳
	TTR   int64  `json:"ttr"`
}

* Job体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL