model

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callback added in v1.0.9

func Callback(g Service, namespace string, identity string, costTime *CostTime, err error) error

func EnableExecute added in v1.0.40

func EnableExecute(g Service, namespace, identity string) bool

Types

type BaseJobData added in v1.0.6

type BaseJobData struct {
	Identity string `json:"identity"`
}

type CostTime added in v1.0.26

type CostTime struct {
	Start time.Time
	Since time.Duration
}

func NewCostTime added in v1.0.26

func NewCostTime() *CostTime

func (*CostTime) GetMillionSecond added in v1.0.26

func (c *CostTime) GetMillionSecond() int64

type ExecHistory added in v1.0.25

type ExecHistory struct {
	Status     string    `json:"history"`
	Message    string    `json:"message"`
	CostTime   int64     `json:"costTime"`
	CompleteAt time.Time `json:"completeAt"`
}

type JobInfo

type JobInfo struct {
	Name   string
	Job    go_worker.Job
	Option *work.JobOptions
}

type Service

type Service interface {
	GetRegisterInfo() *JobInfo
	Do(job *work.Job) error
	GetTaskName() string
	GetConfig() *viper.Viper
	GetMongoClient() *mongo.Client
}

type ServiceEntity

type ServiceEntity struct {
	TaskName    string
	Config      *viper.Viper
	MongoClient *mongo.Client
}

func NewService

func NewService(TaskName string, Config *viper.Viper) *ServiceEntity

func (*ServiceEntity) Do

func (g *ServiceEntity) Do(job *work.Job) error

func (*ServiceEntity) GetConfig added in v0.0.14

func (g *ServiceEntity) GetConfig() *viper.Viper

func (*ServiceEntity) GetMongoClient added in v1.0.12

func (g *ServiceEntity) GetMongoClient() *mongo.Client

func (*ServiceEntity) GetRegisterInfo

func (g *ServiceEntity) GetRegisterInfo() *JobInfo

func (*ServiceEntity) GetTaskName added in v0.0.14

func (g *ServiceEntity) GetTaskName() string

type Status added in v0.0.18

type Status int
const (
	Pending Status = iota
	Running
	Failed
	Succeeded
)

func (Status) String added in v0.0.18

func (p Status) String() string

Jump to

Keyboard shortcuts

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