Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidBrokerType = errors.New("invalid BrokerType")
View Source
var InvalidTaskStatus = errors.New("invalid TaskStatus")
Functions ¶
func MarshalData ¶
func UnmarshalData ¶
Types ¶
type BrokerType ¶
type BrokerType uint8
swagger:enum
const ( BROKER_TYPE_UNKNOWN BrokerType = iota BROKER_TYPE__GEARMAN // gearman BROKER_TYPE__REDIS // redis BROKER_TYPE__KAFKA // kafka )
Broker类型
func ParseBrokerTypeFromLabelString ¶
func ParseBrokerTypeFromLabelString(s string) (BrokerType, error)
func ParseBrokerTypeFromString ¶
func ParseBrokerTypeFromString(s string) (BrokerType, error)
func (BrokerType) EnumType ¶
func (BrokerType) EnumType() string
func (BrokerType) Enums ¶
func (BrokerType) Enums() map[int][]string
func (BrokerType) Label ¶
func (v BrokerType) Label() string
func (BrokerType) MarshalText ¶
func (v BrokerType) MarshalText() ([]byte, error)
func (BrokerType) String ¶
func (v BrokerType) String() string
func (*BrokerType) UnmarshalText ¶
func (v *BrokerType) UnmarshalText(data []byte) (err error)
type ConnectionInfo ¶
type CronTableInfo ¶
type Task ¶
type Task struct { ID string `json:"id"` Channel string `json:"channel"` Subject string `json:"subject"` Data []byte `json:"data,omitempty"` CreateTime time.Time `json:"createTime"` }
func (*Task) Fail ¶
func (t *Task) Fail(err error) *TaskFeedback
func (*Task) Init ¶
func (t *Task) Init() *TaskFeedback
func (*Task) Pending ¶
func (t *Task) Pending() *TaskFeedback
func (*Task) Processing ¶
func (t *Task) Processing() *TaskFeedback
func (*Task) Rollback ¶
func (t *Task) Rollback(err error) *TaskFeedback
func (*Task) Success ¶
func (t *Task) Success(result interface{}) *TaskFeedback
type TaskFeedback ¶
type TaskFeedback struct { ID string `json:"id"` Channel string `json:"channel"` Subject string `json:"subject"` Data []byte `json:"data,omitempty"` Status TaskStatus `json:"status"` UpdateTime time.Time `json:"updateTime"` Result []byte `json:"result,omitempty"` ErrorTrace []byte `json:"errorTrace,omitempty"` }
type TaskProcessor ¶
type TaskStatus ¶
type TaskStatus uint8
swagger:enum
const ( TASK_STATUS_UNKNOWN TaskStatus = iota TASK_STATUS__INIT // 就绪 TASK_STATUS__PENGDING // 已分发 TASK_STATUS__PROCESSING // 执行中 TASK_STATUS__SUCCESS // 已完成 TASK_STATUS__FAIL // 失败 TASK_STATUS__ROLLBACK // 回滚 )
任务状态
func ParseTaskStatusFromLabelString ¶
func ParseTaskStatusFromLabelString(s string) (TaskStatus, error)
func ParseTaskStatusFromString ¶
func ParseTaskStatusFromString(s string) (TaskStatus, error)
func (TaskStatus) EnumType ¶
func (TaskStatus) EnumType() string
func (TaskStatus) Enums ¶
func (TaskStatus) Enums() map[int][]string
func (TaskStatus) Label ¶
func (v TaskStatus) Label() string
func (TaskStatus) MarshalText ¶
func (v TaskStatus) MarshalText() ([]byte, error)
func (TaskStatus) String ¶
func (v TaskStatus) String() string
func (*TaskStatus) UnmarshalText ¶
func (v *TaskStatus) UnmarshalText(data []byte) (err error)
Click to show internal directories.
Click to hide internal directories.