Documentation ¶
Index ¶
- Variables
- func AddJob(spec string, job *Job) bool
- func AllAdminInfo(adminIds string) []*adminInfo
- func GetCounter(key string) int
- func GetEntries(size int) []*cron.Entry
- func GetEntryById(jobKey int) *cron.Entry
- func InitJobs()
- func PollServer(j *Job) bool
- func RemoveJob(jobKey int)
- func SetCounter(key string)
- func TestServer(server *models.TaskServer) error
- type Job
- func NewCommandJob(id int, serverId int, name string, command string) *Job
- func NewJobFromTask(task *models.Task) ([]*Job, error)
- func RemoteCommandJob(id int, serverId int, name string, command string, servers *models.TaskServer) *Job
- func RemoteCommandJobByAgentPassword(id int, serverId int, name string, command string, servers *models.TaskServer) *Job
- func RemoteCommandJobByPassword(id int, serverId int, name string, command string, servers *models.TaskServer) *Job
- func RemoteCommandJobByTelnetPassword(id int, serverId int, name string, command string, servers *models.TaskServer) *Job
- type JobResult
- type RpcResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Counter sync.Map
调度计数器
Functions ¶
func AllAdminInfo ¶
func AllAdminInfo(adminIds string) []*adminInfo
func GetCounter ¶
func GetEntries ¶
func GetEntries(size int) []*cron.Entry
func GetEntryById ¶
func GetEntryById(jobKey int) *cron.Entry
func PollServer ¶
func SetCounter ¶
func SetCounter(key string)
func TestServer ¶
func TestServer(server *models.TaskServer) error
Types ¶
type Job ¶
type Job struct { JobKey int // jobId = id*10000+serverId Id int // taskID LogId int64 // 日志记录ID ServerId int // 执行器信息 ServerName string // 执行器名称 ServerType int // 执行器类型,2-agent 1-telnet 0-ssh Name string // 任务名称 Task *models.Task // 任务对象 RunFunc func(time.Duration) *JobResult // 执行函数 Status int // 任务状态,大于0表示正在执行中 Concurrent bool // 同一个任务是否允许并行执行 }
func RemoteCommandJob ¶
func RemoteCommandJob(id int, serverId int, name string, command string, servers *models.TaskServer) *Job
远程执行任务 密钥验证
Click to show internal directories.
Click to hide internal directories.