Documentation ¶
Overview ¶
gen for home toolset
Index ¶
- func GetAllProvider() []interface{}
- func GetServer(leaders ...interface{}) constraint.KernelServer
- type Broadcast
- type Cron
- type Crontab
- type DelayQueue
- type DelayQueueForMysql
- func (d *DelayQueueForMysql) Del(id string) bool
- func (d *DelayQueueForMysql) Init()
- func (d *DelayQueueForMysql) Loop()
- func (d *DelayQueueForMysql) Push(task DelayTask) string
- func (d *DelayQueueForMysql) Run()
- func (d *DelayQueueForMysql) RunAfterFunc(delayMsg *OrmDelayQueue)
- func (d *DelayQueueForMysql) RunDelayJob(delayMsg *OrmDelayQueue) bool
- type DelayTask
- type Election
- type Http
- type Msg
- type OrmDelayQueue
- type Queue
- func (q *Queue) AddJob(route string, handle constraint.Job)
- func (q *Queue) AddMiddleware(task Task)
- func (q *Queue) CloseBroadcast()
- func (q *Queue) Delay(t time.Duration) *DelayTask
- func (q *Queue) Exit()
- func (q *Queue) HasBroadcast() bool
- func (q *Queue) Init()
- func (q *Queue) Listen(jobs []interface{})
- func (q *Queue) Publish(message interface{}, topics ...string)
- func (q *Queue) Push(message interface{})
- func (q *Queue) Run()
- func (q *Queue) StartBroadcast() *Broadcast
- func (q *Queue) StartDelayQueue()
- type Task
- type Websocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllProvider ¶
func GetAllProvider() []interface{}
func GetServer ¶
func GetServer(leaders ...interface{}) constraint.KernelServer
GetServer 提供统一命名规范的独立服务
Types ¶
type Broadcast ¶
type Crontab ¶
type Crontab struct { Cron *cron.Cron // contains filtered or unexported fields }
Crontab @Bean
func NewCrontab ¶
func NewCrontab() *Crontab
func (*Crontab) AddMiddleware ¶ added in v0.5.0
type DelayQueue ¶ added in v0.3.0
type DelayQueueForMysql ¶ added in v0.3.0
type DelayQueueForMysql struct { RunAfterFuncLimit int64 // contains filtered or unexported fields }
DelayQueueForMysql @Bean("delay_queue")
func NewDelayQueueForMysql ¶ added in v0.3.0
func NewDelayQueueForMysql() *DelayQueueForMysql
func (*DelayQueueForMysql) Del ¶ added in v0.3.0
func (d *DelayQueueForMysql) Del(id string) bool
func (*DelayQueueForMysql) Init ¶ added in v0.3.0
func (d *DelayQueueForMysql) Init()
func (*DelayQueueForMysql) Loop ¶ added in v0.3.0
func (d *DelayQueueForMysql) Loop()
Loop 监控执行 一分钟内的任务,如果系统空闲,直接维护在内存,同时设置数据库in_cache=1 超过一分钟的任务,放到数据库,每分钟加载到内存
func (*DelayQueueForMysql) Push ¶ added in v0.3.0
func (d *DelayQueueForMysql) Push(task DelayTask) string
func (*DelayQueueForMysql) Run ¶ added in v0.3.0
func (d *DelayQueueForMysql) Run()
func (*DelayQueueForMysql) RunAfterFunc ¶ added in v0.4.22
func (d *DelayQueueForMysql) RunAfterFunc(delayMsg *OrmDelayQueue)
func (*DelayQueueForMysql) RunDelayJob ¶ added in v0.4.22
func (d *DelayQueueForMysql) RunDelayJob(delayMsg *OrmDelayQueue) bool
type DelayTask ¶ added in v0.3.0
type DelayTask struct {
// contains filtered or unexported fields
}
DelayTask 延时队列包装
type Election ¶
type Election struct { // 队列配置文件的所有配置 *services.Config `inject:"config, election"` // 连接 Connect *services.Redis // contains filtered or unexported fields }
Election @Bean("election")
func NewElection ¶
func NewElection() *Election
type Http ¶
type Http struct { *providers.RouteProvider `inject:""` *services.HttpServer `inject:""` *services.Config `inject:"config, app.servers.http"` *gin.Engine Middleware []gin.HandlerFunc MiddlewareGroup map[string][]gin.HandlerFunc Port string // contains filtered or unexported fields }
Http 提供者 @Bean("http")
type OrmDelayQueue ¶ added in v0.3.0
type OrmDelayQueue struct { Id string `gorm:"column:id;type:varchar(64);primaryKey"` // Fail uint64 `gorm:"column:fail;type:bigint(20) unsigned;default:0;comment:'失败次数'"` // 失败次数 Route string `gorm:"column:route;type:varchar(254);comment:'路由'"` // 路由 Job database.JSON `gorm:"column:job;type:json;comment:'任务信息'"` // 任务信息 RunAt database.Time `` // 执行时间点 /* 130-byte string literal not displayed */ CreatedAt database.Time `gorm:"column:created_at;type:timestamp;default:2022-08-25 00:00:00;comment:'创建时间'"` // 创建时间 InCache uint32 `gorm:"column:in_cache;type:tinyint(4) unsigned;default:0;comment:'是否加入缓存'"` // 是否加入缓存 }
OrmDelayQueue @Bean
func NewOrmDelayQueue ¶ added in v0.3.0
func NewOrmDelayQueue() *OrmDelayQueue
func (*OrmDelayQueue) TableName ¶ added in v0.3.0
func (receiver *OrmDelayQueue) TableName() string
type Queue ¶
type Queue struct { // 连接 Connect *services.Redis `inject:"database, @config(queue.connection)"` // contains filtered or unexported fields }
Queue @Bean("queue")
func (*Queue) AddMiddleware ¶ added in v0.5.0
func (*Queue) CloseBroadcast ¶ added in v0.0.3
func (q *Queue) CloseBroadcast()
func (*Queue) HasBroadcast ¶
func (*Queue) StartBroadcast ¶
func (*Queue) StartDelayQueue ¶ added in v0.1.9
func (q *Queue) StartDelayQueue()
StartDelayQueue 开启延时队列
type Task ¶ added in v0.5.0
type Task func(job constraint.Job, next func(constraint.Job))
Click to show internal directories.
Click to hide internal directories.