Documentation
¶
Index ¶
- Constants
- Variables
- func GetRoutingKeyByTopic(topicName string) string
- func GetServerTaskAMPQServer(topicName string) *machinery.Server
- func GetTopicByMQRoutingKey(routingKey string) string
- func GetTopicByTaskName(taskName string, workspaceGUID string) string
- func GetWorkerAMPQServer(topicName string, prefetchCount int) *machinery.Server
- type TaskResult
- type WorkerRunTaskMode
- type WorkerStatus
Constants ¶
View Source
const ( CREATED string = "CREATED" //任务创建,但还没有开始执行 REVOKED string = "REVOKED" //任务被取消执行 STARTED string = tasks.StateStarted //任务在执行中 SUCCESS string = tasks.StateSuccess //任务执行完成,结果为SUCCESS FAILURE string = tasks.StateFailure //任务执行完成,结果为FAILURE RECEIVED string = tasks.StateReceived //未使用 PENDING string = tasks.StatePending //未使用 RETRY string = tasks.StateRetry //未使用 TopicActive = "active" TopicFinger = "finger" TopicPassive = "passive" TopicPocscan = "pocscan" TopicCustom = "custom" TopicMQPrefix = "nemo_mq" )
Variables ¶
View Source
var CustomTaskWorkspaceMap = make(map[string]struct{})
CustomTaskWorkspaceMap 自定义任务关联的工作空间GUID
Functions ¶
func GetRoutingKeyByTopic ¶
func GetServerTaskAMPQServer ¶
func GetServerTaskAMPQServer(topicName string) *machinery.Server
GetServerTaskAMPQServer 根据server配置文件,获取到消息中心的连接
func GetTopicByMQRoutingKey ¶
func GetTopicByTaskName ¶
func GetWorkerAMPQServer ¶
GetWorkerAMPQServer 根据worker配置文件,获取到消息中心的连接
Types ¶
type TaskResult ¶
type WorkerRunTaskMode ¶
type WorkerRunTaskMode int
const ( TaskModeDefault WorkerRunTaskMode = iota TaskModeActive TaskModeFinger TaskModePassive TaskModePocscan TaskModeCustom )
type WorkerStatus ¶
type WorkerStatus struct { sync.Mutex `json:"-"` // worker's task status WorkerName string `json:"worker_name"` WorkerTopics string `json:"worker_topic"` CreateTime time.Time `json:"create_time"` UpdateTime time.Time `json:"update_time"` TaskExecutedNumber int `json:"task_number"` TaskStartedNumber int `json:"started_number"` // worker's run status ManualReloadFlag bool `json:"manual_reload_flag"` ManualFileSyncFlag bool `json:"manual_file_sync_flag"` ManualUpdateOptionFlag bool `json:"manual_update_daemon_option"` CPULoad string `json:"cpu_load"` MemUsed string `json:"mem_used"` // worker's option WorkerRunOption []byte `json:"worker_run_option"` //worker当前运行的启动参数 WorkerUpdateOption []byte `json:"worker_update_option"` //worker需要更新的启动参数 // daemon option IsDaemonProcess bool `json:"is_daemon_process"` WorkerDaemonUpdateTime time.Time `json:"worker_daemon_update_time"` }
Click to show internal directories.
Click to hide internal directories.