agentmanager

package
v1.0.4-0...-d8282c0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Wangjunqi123 <wangjunqi@kylinos.cn> * Date: Mon Nov 4 14:30:13 2024 +0800

* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Wangjunqi123 <wangjunqi@kylinos.cn> * Date: Mon Nov 4 14:30:13 2024 +0800

* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Wangjunqi123 <wangjunqi@kylinos.cn> * Date: Mon Nov 4 14:30:13 2024 +0800

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAgentManager

func InitAgentManager()

func Wait4TopoServerReady

func Wait4TopoServerReady()

func WaitingForHandshake

func WaitingForHandshake()

Types

type Agent

type Agent struct {
	ID         uint   `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	UUID       string `gorm:"not null;unique" json:"uuid"`
	IP         string `gorm:"not null" json:"IP"`
	Port       string `gorm:"not null" json:"port"`
	Departid   string `json:"departid"`
	Departname string `json:"departname"`
	State      int    `gorm:"not null" json:"state"`
	TAState    int    `json:"TAstate"` // topo agent state: true(running) false(not runnings)

	Host_2             *graph.Host            `json:"host"`
	Processes_2        []*graph.Process       `json:"processes"`
	Netconnections_2   []*graph.Netconnection `json:"netconnections"`
	NetIOcounters_2    []*graph.NetIOcounter  `json:"netiocounters"`
	AddrInterfaceMap_2 map[string][]string    `json:"addrinterfacemap"`
	Disks_2            []*graph.Disk          `json:"disks"`
	Cpus_2             []*graph.Cpu           `json:"cpus"`
}

type AgentManager

type AgentManager struct {
	PAgentMap sync.Map
	TAgentMap sync.Map

	AgentPort string
}
var Global_AgentManager *AgentManager

func (*AgentManager) AddAgent_P

func (am *AgentManager) AddAgent_P(a *Agent)

func (*AgentManager) AddAgent_T

func (am *AgentManager) AddAgent_T(a *Agent)

func (*AgentManager) DeleteAgent_P

func (am *AgentManager) DeleteAgent_P(uuid string)

func (*AgentManager) DeleteAgent_T

func (am *AgentManager) DeleteAgent_T(uuid string)

func (*AgentManager) GetAgent_P

func (am *AgentManager) GetAgent_P(uuid string) *Agent

func (*AgentManager) GetAgent_T

func (am *AgentManager) GetAgent_T(uuid string) *Agent

func (*AgentManager) InitMachineList

func (am *AgentManager) InitMachineList()

初始化PAgentMap中的agent

func (*AgentManager) UpdateMachineList

func (am *AgentManager) UpdateMachineList()

更新PAgentMap中的agent

Jump to

Keyboard shortcuts

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