Documentation ¶
Index ¶
- Constants
- func ActionDeleteAgent(agentId string, onFail func(message string)) (goNext bool)
- func AddItemState(itemId string, itemState *ItemState)
- func AddTabbar(actionWrapper actions.ActionWrapper)
- func CheckHostConnectivity(host string, port int, timeout time.Duration) (cost time.Duration, b bool)
- func ConvertReceiversToMaps(receivers []*notices.NoticeReceiver) (result []maps.Map)
- func DisableAgentQueue(agentId string, c chan *AgentEvent)
- func FindAgentRuntime(agentConfig *agents.AgentConfig) *agents.AgentConfig
- func FindNoticeLinks(notice *notices.Notice) (links []maps.Map)
- func FindSharedAgents(currentAgentId string, groupIds []string, app *agents.AppConfig) []*agents.AgentConfig
- func FormatTask(task *agents.TaskConfig, agentId string) maps.Map
- func InitAppData(actionWrapper actions.ActionWrapper, agentId string, appId string, ...) *agents.AppConfig
- func ParseHostRules(rules string, max int) (result []string)
- func PostAgentEvent(agentId string, event *AgentEvent)
- func RemoveAgentQueue(agentId string, c chan *AgentEvent)
- func RemoveItemState(itemId string)
- func SyncAddChart(currentAgentId string, groupIds []string, app *agents.AppConfig, itemId string, ...) error
- func SyncApp(currentAgentId string, groupIds []string, app *agents.AppConfig, ...) error
- func SyncAppEvent(currentAgentId string, groupIds []string, app *agents.AppConfig, ...) error
- func SyncRemoveChart(currentAgentId string, groupIds []string, app *agents.AppConfig, ...) error
- func WaitAgentQueue(agentId string, agentVersion string, osName string, speed float64, ip string, ...)
- type AgentEvent
- type AgentState
- type Installer
- type ItemState
- type SSHAuthType
Constants ¶
View Source
const ( SSHAuthTypePassword = "password" SSHAuthTypeKey = "key" )
Variables ¶
This section is empty.
Functions ¶
func ActionDeleteAgent ¶ added in v0.1.6
func AddTabbar ¶
func AddTabbar(actionWrapper actions.ActionWrapper)
func CheckHostConnectivity ¶ added in v0.1.2
func CheckHostConnectivity(host string, port int, timeout time.Duration) (cost time.Duration, b bool)
检查主机设置
func ConvertReceiversToMaps ¶ added in v0.1.8
func ConvertReceiversToMaps(receivers []*notices.NoticeReceiver) (result []maps.Map)
将Receiver转换为Map
func DisableAgentQueue ¶ added in v0.1.7
func DisableAgentQueue(agentId string, c chan *AgentEvent)
禁用Channel
func FindAgentRuntime ¶
func FindAgentRuntime(agentConfig *agents.AgentConfig) *agents.AgentConfig
查找正在运行中的Agent,用来维护Agent的状态
func FindSharedAgents ¶ added in v0.1.2
func FindSharedAgents(currentAgentId string, groupIds []string, app *agents.AppConfig) []*agents.AgentConfig
查找共享的Agent
func InitAppData ¶
func InitAppData(actionWrapper actions.ActionWrapper, agentId string, appId string, tabbar string) *agents.AppConfig
App菜单
func ParseHostRules ¶ added in v0.1.2
分析主机规则
func SyncAddChart ¶ added in v0.1.2
func SyncAddChart(currentAgentId string, groupIds []string, app *agents.AppConfig, itemId string, chartId string) error
添加Chart
func SyncApp ¶ added in v0.1.2
func SyncApp(currentAgentId string, groupIds []string, app *agents.AppConfig, event *AgentEvent, op func(agent *agents.AgentConfig) error) error
同步App到其他Agents op是附加操作
func SyncAppEvent ¶ added in v0.1.2
func SyncAppEvent(currentAgentId string, groupIds []string, app *agents.AppConfig, event *AgentEvent) error
仅同步Event
func SyncRemoveChart ¶ added in v0.1.2
func SyncRemoveChart(currentAgentId string, groupIds []string, app *agents.AppConfig, chartId string) error
仅同步Chart
func WaitAgentQueue ¶
func WaitAgentQueue(agentId string, agentVersion string, osName string, speed float64, ip string, c chan *AgentEvent)
等待Agent事件
Types ¶
type AgentEvent ¶ added in v0.1.7
type AgentEvent struct { Name string `json:"name"` Data interface{} `json:"data"` }
Agent事件
type AgentState ¶ added in v0.1.7
type AgentState struct { Version string // 版本号 OsName string // 操作系统 Speed float64 // 连接速度,ms IP string // IP地址 IsAvailable bool // 是否可用 }
Agent状态
func CheckAgentIsWaiting ¶
func CheckAgentIsWaiting(agentId string) (state *AgentState, isWaiting bool)
检查Agent是否正在运行
type Installer ¶ added in v0.1.2
type ItemState ¶ added in v0.1.7
type ItemState struct {
IsFailed bool // 是否已失败
}
监控项状态
func FindItemState ¶ added in v0.1.7
查找监控项状态
Click to show internal directories.
Click to hide internal directories.