job

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func(ctx *server.Context) Resp

type HandlerList

type HandlerList struct {
	sync.Map
}
var (
	RunningHandlerList *HandlerList
	AllHandlerList     *HandlerList
)

func GetAllHandlerList

func GetAllHandlerList() *HandlerList

func GetRunningJobList

func GetRunningJobList() *HandlerList

func (*HandlerList) Del

func (t *HandlerList) Del(key string)

func (*HandlerList) Get

func (t *HandlerList) Get(key string) (Job, bool)

func (*HandlerList) Set

func (t *HandlerList) Set(key string, val Job)

type Job

type Job struct {
	Id        int64
	Name      string
	Ext       context.Context
	Cancel    context.CancelFunc
	Fn        Func
	Param     *server.RunReq
	StartTime int64
	EndTime   int64
}

type Resp

type Resp struct {
	LogID       int64  `json:"logId"`
	LogDateTime int64  `json:"logDateTime"`
	HandleCode  int    `json:"handleCode"`
	HandleMsg   string `json:"handleMsg"`
}

Jump to

Keyboard shortcuts

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