server

package
v2.8.1-0...-89a7925 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

*********************************************************** ** @Description: server ** @Author: george hao ** @Date: 2018-11-29 11:13 ** @Last Modified by: george hao ** @Last Modified time: 2018-11-29 11:13 ************************************************************

*********************************************************** ** @Description: job ** @Author: george hao ** @Date: 2019-06-24 15:14 ** @Last Modified by: george hao ** @Last Modified time: 2019-06-24 15:14 ************************************************************

*********************************************************** ** @Description: log ** @Author: haodaquan ** @Date: 2018-08-22 23:00 ** @Last Modified by: haodaquan ** @Last Modified time: 2018-08-22 23:00 ************************************************************

*********************************************************** ** @Description: notify ** @Author: george hao ** @Date: 2019-06-26 15:17 ** @Last Modified by: george hao ** @Last Modified time: 2019-06-26 15:17 ************************************************************

*********************************************************** ** @Description: service ** @Author: george hao ** @Date: 2019-06-26 15:27 ** @Last Modified by: george hao ** @Last Modified time: 2019-06-26 15:27 ************************************************************

*********************************************************** ** @Description: server ** @Author: george hao ** @Date: 2018-11-29 11:24 ** @Last Modified by: george hao ** @Last Modified time: 2018-11-29 11:24 ************************************************************

*********************************************************** ** @Description: task ** @Author: george hao ** @Date: 2019-06-24 13:22 ** @Last Modified by: george hao ** @Last Modified time: 2019-06-24 13:22 ************************************************************

Index

Constants

This section is empty.

Variables

View Source
var CmdMap sync.Map

执行句柄map

View Source
var ConfPath string

Functions

func Close

func Close() error

程序异常退出的通知

func GetCmdMap

func GetCmdMap(key string) *exec.Cmd

func Heartbeat

func Heartbeat() error

心跳机制

func InitConfig

func InitConfig(path string) error

func ListenSignal

func ListenSignal()

监听关闭状态

func NLog

func NLog(level string, value ...interface{})

系统运行相关

func Register

func Register() error

启动时注册

func ResetCommandJob

func ResetCommandJob(id int, serverId int, name string, command string) *Job

func RestJobFromTask

func RestJobFromTask(task *models.Task, serverId int) (*Job, error)

func RpcRun

func RpcRun() error

func Run

func Run(j *Job) *JobResult

func SaveConfig

func SaveConfig(key string, value string) error

func SetCmdMap

func SetCmdMap(key string, cmd *exec.Cmd)

func WriteLog

func WriteLog(r *http.Request, t time.Time, match string, pattern string)

http相关

Types

type RpcResult

type RpcResult struct {
	Status  int
	Message string
}

type RpcTask

type RpcTask struct {
}

func (*RpcTask) HeartBeat

func (r *RpcTask) HeartBeat(ping string, reply *RpcResult) error

func (*RpcTask) KillCommand

func (r *RpcTask) KillCommand(task models.Task, reply *RpcResult) error

Kill execution

func (*RpcTask) RunTask

func (r *RpcTask) RunTask(task *models.Task, Result *jobs.JobResult) error

Execute once

Jump to

Keyboard shortcuts

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