Documentation ¶
Overview ¶
gen for home toolset
Index ¶
- func GetAllProvider() []interface{}
- func GetServer(leaders ...interface{}) constraint.KernelServer
- type Broadcast
- type Crontab
- type DelayQueue
- type DelayQueueForMysql
- type DelayTask
- type Election
- type Http
- type Msg
- type OrmDelayQueue
- type Queue
- func (q *Queue) AddJob(route string, handle constraint.Job)
- 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()
- func (q *Queue) StartDelayQueue()
- 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
type DelayQueue ¶ added in v0.3.0
type DelayQueueForMysql ¶ added in v0.3.0
type DelayQueueForMysql struct {
// 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 TODO 待优化,如果启动了广播,可以内存维护多个节点的最近任务,可以去掉定时查询
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()
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:"primaryKey;autoIncrement;column:id;type:varchar(64);not null" json:"id"` Fail int `gorm:"column:fail;type:int" json:"fail"` Route string `gorm:"column:route;type:varchar(254)" json:"route"` Job database.JSON `gorm:"column:job;type:json" json:"job"` RunAt database.Time `gorm:"column:run_at;type:timestamp;index;not null" json:"run_at"` CreatedAt database.Time `gorm:"column:created_at;type:timestamp;not null;default:'2022-08-25 00:00:00'" json:"created_at"` }
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) CloseBroadcast ¶ added in v0.0.3
func (q *Queue) CloseBroadcast()
func (*Queue) HasBroadcast ¶
func (*Queue) StartBroadcast ¶
func (q *Queue) StartBroadcast()
func (*Queue) StartDelayQueue ¶ added in v0.1.9
func (q *Queue) StartDelayQueue()
StartDelayQueue 开启延时队列
Click to show internal directories.
Click to hide internal directories.