model

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReleaseTask

func ReleaseTask(t *Task)

Types

type DbTask

type DbTask struct {
	Id uint `json:"id"`

	Token        string      `json:"token"`
	Uid          string      `json:"uid"`
	Score        int64       `json:"score"`
	Name         string      `json:"name"`
	Type         pb.TaskType `json:"type"`
	Times        int         `json:"times"`          // 发送次数
	RetryTimes   int         `json:"retry_times"`    // 重试次数
	ExecTime     time.Time   `json:"exec_time"`      // 执行时间
	NextExecTime *time.Time  `json:"next_exec_time"` // 下次执行时间

	Schema  string `json:"schema"`
	Address string `json:"address"`
	Path    string `json:"path"`

	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
}

func (*DbTask) TableName

func (t *DbTask) TableName() string

type MongoTask

type MongoTask struct {
	Id primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty" copy:"-"`

	Score        int64  `json:"score" bson:"score"`
	Token        string `json:"token" bson:"token"`
	Uid          string `json:"uid" bson:"uid"`
	Name         string `json:"name" bson:"name"`
	Args         string `json:"args" bson:"args"`
	Type         int32  `json:"type" bson:"type"`
	Times        int    `json:"times" bson:"times"`                             // 发送次数
	RetryTimes   int    `json:"retry_times" bson:"retry_times"`                 // 重试次数
	ExecTime     int64  `json:"exec_time" bson:"exec_time"`                     // 执行时间
	NextExecTime int64  `json:"next_exec_time,omitempty" bson:"next_exec_time"` // 下次执行时间

	Schema  string `json:"schema,omitempty" bson:"schema"`
	Address string `json:"address,omitempty" bson:"address"`
	Path    string `json:"path,omitempty" bson:"path"`

	CreatedAt int64 `json:"created_at,omitempty" bson:"created_at"`
	UpdatedAt int64 `json:"updated_at,omitempty" bson:"updated_at"`
	DeletedAt int64 `json:"deleted_at,omitempty" bson:"deleted_at"`
}

func (*MongoTask) Collection

func (mt *MongoTask) Collection() string

func (*MongoTask) ConvertTask

func (mt *MongoTask) ConvertTask(cp xcopy.XCopy, t *Task)

type RedisTask

type RedisTask map[string]interface{}

func (RedisTask) Args

func (rt RedisTask) Args(args *[]interface{})

type Task

type Task struct {
	Id string `json:"id,omitempty"`

	Score        int64  `json:"score"`
	Uid          string `json:"uid"`
	Name         string `json:"name"`
	Args         string `json:"args"`
	Type         int32  `json:"type"`
	Times        int    `json:"times"`                    // 发送次数
	RetryTimes   int    `json:"retry_times"`              // 重试次数
	ExecTime     int64  `json:"exec_time"`                // 执行时间
	NextExecTime int64  `json:"next_exec_time,omitempty"` // 下次执行时间

	Schema  string `json:"schema,omitempty"`
	Address string `json:"address,omitempty"`
	Path    string `json:"path,omitempty"`

	CreatedAt int64 `json:"created_at,omitempty"`
	UpdatedAt int64 `json:"updated_at,omitempty"`
	DeletedAt int64 `json:"deleted_at,omitempty"`
}

func GenerateTask

func GenerateTask() *Task

func (*Task) ConvertMongoTask

func (t *Task) ConvertMongoTask(cp xcopy.XCopy, mt *MongoTask)

func (*Task) ConvertRedisTask

func (t *Task) ConvertRedisTask() RedisTask

func (*Task) NextDelayTime

func (t *Task) NextDelayTime() time.Duration

Jump to

Keyboard shortcuts

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