master

package
v0.0.0-...-e409f06 Latest Latest
Warning

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

Go to latest
Published: May 18, 2019 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitApiServer

func InitApiServer() (err error)

初始化服务

func InitConfig

func InitConfig(filename string) (err error)

加载配置

func InitJobMgr

func InitJobMgr() (err error)

func InitLogMgr

func InitLogMgr() (err error)

func InitWorkerMgr

func InitWorkerMgr() (err error)

Types

type ApiServer

type ApiServer struct {
	// contains filtered or unexported fields
}

任务的HTTP接口

var (
	// 单例对象
	G_apiServer *ApiServer
)

type Config

type Config struct {
	ApiPort               int      `json:"apiPort"`
	ApiReadTimeout        int      `json:"apiReadTimeout"`
	ApiWriteTimeout       int      `json:"apiWriteTimeout"`
	EtcdEndpoints         []string `json:"etcdEndpoints"`
	EtcdDialTimeout       int      `json:"etcdDialTimeout"`
	WebRoot               string   `json:"webroot"`
	MongodbUri            string   `json:"MongoDBUri"`
	MongodbConnectTimeout int      `json:"mongoDBConnectTimeout"`
}

程序配置

var (
	// 单例
	G_config *Config
)

type JobMgr

type JobMgr struct {
	// contains filtered or unexported fields
}

任务管理器

var (
	// 单例
	G_jobMgr *JobMgr
)

func (*JobMgr) DeleteJob

func (jobMgr *JobMgr) DeleteJob(name string) (oldJob *common.Job, err error)

删除任务

func (*JobMgr) KillJob

func (JobMgr *JobMgr) KillJob(name string) (err error)

杀死任务

func (*JobMgr) ListJobs

func (jobMgr *JobMgr) ListJobs() (jobList []*common.Job, err error)

列举任务列表

func (*JobMgr) SaveJob

func (jobMgr *JobMgr) SaveJob(job *common.Job) (oldJob *common.Job, err error)

保存任务

type LogMgr

type LogMgr struct {
	// contains filtered or unexported fields
}

Mongo打包日志管理

var (
	G_logMgr *LogMgr
)

func (*LogMgr) ListLog

func (logMgr *LogMgr) ListLog(name string, skip int, limit int) (logArr []*common.JobLog, err error)

查看任务日志

type WorkerMgr

type WorkerMgr struct {
	// contains filtered or unexported fields
}

/cron/workers/

var (
	G_workerMgr *WorkerMgr
)

func (*WorkerMgr) ListWorkers

func (workerMgr *WorkerMgr) ListWorkers() (workerArr []string, err error)

获取在线worker列表

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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