constants

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

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 MarshalData(v interface{}) ([]byte, error)

func UnmarshalData

func UnmarshalData(data []byte, v interface{}) error

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 ConnectionInfo struct {
	Protocol string           `conf:"env"`
	Host     string           `conf:"env,upstream"`
	Port     int32            `conf:"env"`
	UserName string           `conf:"env"`
	Password presets.Password `conf:"env"`
}

type CronTableInfo

type CronTableInfo struct {
	CronTableID string                 `json:"cronTableID"`
	Channel     string                 `json:"channel"`
	Subject     string                 `json:"subject"`
	Spec        string                 `json:"spec"`
	Args        string                 `json:"args"`
	NextTime    timelib.MySQLTimestamp `json:"nextTime"`
	Desc        string                 `json:"desc"`
}

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 TaskProcessor func(*Task) (interface{}, error)

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)

Jump to

Keyboard shortcuts

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