Documentation ¶
Index ¶
- type BizSection
- type EventArgs
- type IDAutoSection
- type LockSection
- type MqMessage
- func (p MqMessage) Database() string
- func (s MqMessage) GetBizId() uint64
- func (s MqMessage) GetCategory() uint32
- func (s MqMessage) GetKey() []byte
- func (s MqMessage) GetName() string
- func (s MqMessage) GetTimeout() time.Duration
- func (s MqMessage) GetTopic() string
- func (s MqMessage) GetValue() []byte
- func (s MqMessage) ID() any
- func (s MqMessage) TableName() string
- func (p MqMessage) ToJson() string
- func (p MqMessage) ToRow() []string
- type OperationSection
- type RawBizSection
- type TaskQueueMessage
- func (p TaskQueueMessage) Database() string
- func (s TaskQueueMessage) GetBizId() uint64
- func (s TaskQueueMessage) GetCategory() uint32
- func (s TaskQueueMessage) GetName() string
- func (s TaskQueueMessage) GetTimeout() time.Duration
- func (s TaskQueueMessage) ID() any
- func (s TaskQueueMessage) TableName() string
- func (p TaskQueueMessage) ToJson() string
- func (p TaskQueueMessage) ToRow() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BizSection ¶
type BizSection struct {
RawBizSection
}
BizSection
func (BizSection) DbSharding ¶
func (s BizSection) DbSharding(keys ...any) string
type EventArgs ¶ added in v0.3.14
type EventArgs struct { BizSection Id string // 消息唯一ID Topic string // 事件主题 Key string // 事件Key Value any // 事件主体 }
type IDAutoSection ¶
type IDAutoSection struct {
Id uint64 `json:"id" gorm:"column:id;type:bigint;primaryKey;comment:唯一ID"` // 主键ID
}
IDAutoSection
func (IDAutoSection) ID ¶
func (p IDAutoSection) ID() any
type LockSection ¶
type LockSection struct { Locker string `json:"locaker" gorm:"column:locker;type:varchar(36);default:0;index;comment:防竞争锁"` // 防竞争锁 Expire int64 `json:"expire" gorm:"column:expire;type:bigint;default:0;index;comment:锁有效期"` // 锁有效期 Timeout int64 `json:"timeout" gorm:"column:timeout;<-:create;type:bigint;default:0;comment:任务超时(秒)"` // 任务超时时间 LastError string `json:"lastError" gorm:"column:lastError;type:varchar(255);comment:最后失败原因"` // 最后失败原因 LastExecAt int64 `json:"lastExecAt" gorm:"column:lastExecAt;type:bigint;comment:最后执行时间"` // 最后执行时间 Retries int32 `json:"retries" gorm:"column:retries;type:int;default:0;index;comment:执行次数"` // 重试次数 }
LockSection
type MqMessage ¶ added in v0.3.4
type MqMessage struct {
TaskQueueMessage `gorm:"embedded"`
}
func NewMqMessage ¶ added in v0.3.8
func (MqMessage) GetCategory ¶ added in v0.3.4
func (MqMessage) GetTimeout ¶ added in v0.3.4
type OperationSection ¶
type OperationSection struct { Status int32 `json:"status" gorm:"column:status;type:int;default:1;comment:状态"` // 状态 0-默认 1-未发布 2-预发布 3-发布中 4-已结束 CreateBy int64 `json:"createBy" gorm:"column:createBy;<-:create;index;type:bigint;comment:创建者"` // 创建者 CreateAt int64 `json:"createAt" gorm:"column:createAt;<-:create;index;autoCreateTime;comment:创建时间"` // 创建时间 UpdateBy int64 `json:"updateBy" gorm:"column:updateBy;type:bigint;comment:修改者"` // 修改者 UpdateAt int64 `json:"updateAt" gorm:"column:updateAt;index;autoUpdateTime;comment:修改时间"` // 修改时间 Describe string `json:"describe" gorm:"column:describe;type:varchar(255);comment:描述"` // 描述 }
OperationSection
type RawBizSection ¶ added in v0.2.6
type RawBizSection struct {
BizId uint64 `json:"bizId" gorm:"column:bizId;type:bigint;index:biz;comment:业务ID"` // biz id
}
RawBizSection
func (RawBizSection) Database ¶ added in v0.2.6
func (s RawBizSection) Database() string
type TaskQueueMessage ¶
type TaskQueueMessage struct { dependency.EmptyPo IDAutoSection `gorm:"embedded"` RawBizSection `gorm:"embedded"` Db string `json:"db" gorm:"column:db;type:varchar(36);comment:db"` // db Category uint32 `json:"category" gorm:"column:category;type:int;index:biz;comment:类别"` // 类别 // 1-导出任务 Name string `json:"name" gorm:"column:name;type:varchar(36);index:biz;comment:任务"` // 业务类型 Key string `json:"key" gorm:"column:key;type:varchar(36);comment:分区ID"` // 分区ID Args string `json:"args" gorm:"column:args;type:text;comment:参数"` TraceId string `json:"traceId" gorm:"column:traceId;type:varchar(36);default:0;comment:追踪链路ID"` // 关联traceId LockSection `gorm:"embedded"` CreateBy int64 `json:"createBy" gorm:"column:createBy;<-:create;index;type:bigint;comment:创建者"` // 创建者 CreateAt int64 `json:"createAt" gorm:"column:createAt;<-:create;index;autoCreateTime;comment:创建时间"` // 创建时间 UpdateBy int64 `json:"updateBy" gorm:"column:updateBy;type:bigint;comment:修改者"` // 修改者 UpdateAt int64 `json:"updateAt" gorm:"column:updateAt;index;autoUpdateTime;comment:修改时间"` // 修改时间 }
func (TaskQueueMessage) Database ¶ added in v0.2.5
func (p TaskQueueMessage) Database() string
func (TaskQueueMessage) GetBizId ¶ added in v0.2.5
func (s TaskQueueMessage) GetBizId() uint64
func (TaskQueueMessage) GetCategory ¶ added in v0.2.5
func (s TaskQueueMessage) GetCategory() uint32
func (TaskQueueMessage) GetName ¶ added in v0.2.5
func (s TaskQueueMessage) GetName() string
func (TaskQueueMessage) GetTimeout ¶ added in v0.2.5
func (s TaskQueueMessage) GetTimeout() time.Duration
func (TaskQueueMessage) ID ¶
func (s TaskQueueMessage) ID() any
func (TaskQueueMessage) TableName ¶
func (s TaskQueueMessage) TableName() string
func (TaskQueueMessage) ToJson ¶ added in v0.2.5
func (p TaskQueueMessage) ToJson() string
func (TaskQueueMessage) ToRow ¶ added in v0.2.5
func (p TaskQueueMessage) ToRow() []string
Click to show internal directories.
Click to hide internal directories.