agentutils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: MIT Imports: 20 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTabbar

func AddTabbar(actionWrapper actions.ActionWrapper)

func CheckAgentIsWaiting

func CheckAgentIsWaiting(agentId string) bool

是否正在运行

func FindAgentApp

func FindAgentApp(agent *agents.AgentConfig, appId string) *agents.AppConfig

func FindAgentRuntime

func FindAgentRuntime(agentConfig *agents.AgentConfig) *agents.AgentConfig
func FindNoticeLinks(notice *notices.Notice) (links []maps.Map)

查找通知相关的Link

func FormatTask

func FormatTask(task *agents.TaskConfig, agentId string) maps.Map

格式化任务信息

func InitAppData

func InitAppData(actionWrapper actions.ActionWrapper, agentId string, appId string, tabbar string) *agents.AppConfig

App菜单

func PostAgentEvent

func PostAgentEvent(agentId string, event *Event)

发送Agent事件

func RemoveAgentQueue

func RemoveAgentQueue(agentId string, c chan *Event)

删除Agent

func WaitAgentQueue

func WaitAgentQueue(agentId string, c chan *Event)

等待Agent事件

Types

type Event

type Event struct {
	Name string      `json:"name"`
	Data interface{} `json:"data"`
}

func NewAgentEvent

func NewAgentEvent(name string, data interface{}) *Event

新Agent事件

type ProcessLog

type ProcessLog struct {
	Id         primitive.ObjectID `var:"id" bson:"_id" json:"id"` // 数据库存储的ID
	AgentId    string             `bson:"agentId" json:"agentId"`
	TaskId     string             `bson:"taskId" json:"taskId"`
	ProcessId  string             `bson:"processId" json:"processId"`
	ProcessPid int                `bson:"processPid" json:"processPid"`
	EventType  string             `bson:"eventType" json:"eventType"` // start, log, stop
	Data       string             `bson:"data" json:"data"`
	Timestamp  int64              `bson:"timestamp" json:"timestamp"` // unix时间戳,单位为秒
	TimeFormat struct {
		Year   string `bson:"year" json:"year"`
		Month  string `bson:"month" json:"month"`
		Day    string `bson:"day" json:"day"`
		Hour   string `bson:"hour" json:"hour"`
		Minute string `bson:"minute" json:"minute"`
		Second string `bson:"second" json:"second"`
	} `bson:"timeFormat" json:"timeFormat"`
}

进程日志

Jump to

Keyboard shortcuts

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