Documentation ¶
Index ¶
- Variables
- func AddDeploy(name, configFile, guid string, param map[string]string, configHash string) (port int, err error)
- func CleanDeployDir()
- func DeleteDeploy(guid string) error
- func GetPort() int
- func InitConfig(cfg string) error
- func InitDeploy()
- func InitDeployDir(param []*AgentManagerTable) error
- func InitLocalIp() bool
- func LoadDeployProcess()
- func PrintProcessList() []byte
- func SaveDeployProcess()
- func StartManager()
- func StopDeployProcess()
- type AgentManagerTable
- type AgentsConfig
- type DeployConfig
- type GlobalConfig
- type HttpConfig
- type HttpResponse
- type InitDeployParam
- type ManagerConfig
- type ProcessConfig
- type ProcessObj
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProcessMapLock = new(sync.RWMutex) GlobalProcessMap = make(map[string]*ProcessObj) RemoteMode = false )
View Source
var LocalIp string
Functions ¶
func CleanDeployDir ¶
func CleanDeployDir()
func DeleteDeploy ¶
func InitConfig ¶
func InitDeploy ¶
func InitDeploy()
func InitDeployDir ¶
func InitDeployDir(param []*AgentManagerTable) error
func InitLocalIp ¶
func InitLocalIp() bool
func LoadDeployProcess ¶
func LoadDeployProcess()
func PrintProcessList ¶
func PrintProcessList() []byte
func SaveDeployProcess ¶
func SaveDeployProcess()
func StartManager ¶
func StartManager()
func StopDeployProcess ¶
func StopDeployProcess()
Types ¶
type AgentManagerTable ¶
type AgentManagerTable struct { EndpointGuid string `json:"endpoint_guid"` Name string `json:"name"` User string `json:"user"` Password string `json:"password"` InstanceAddress string `json:"instance_address"` AgentAddress string `json:"agent_address"` ConfigFile string `json:"config_file"` BinPath string `json:"bin_path"` AgentRemotePort string `json:"agent_remote_port"` }
type AgentsConfig ¶
type AgentsConfig struct { Process []*ProcessConfig `json:"process"` HttpRegisterEnable bool `json:"http_register_enable"` }
type DeployConfig ¶
type GlobalConfig ¶
type GlobalConfig struct { Http *HttpConfig `json:"http"` Deploy *DeployConfig `json:"deploy"` Manager *ManagerConfig `json:"manager"` Agents *AgentsConfig `json:"agents"` OsBash []string `json:"os_bash"` RemoteMode string `json:"remote_mode"` }
func Config ¶
func Config() *GlobalConfig
type HttpConfig ¶
type HttpConfig struct {
Port int `json:"port"`
}
type HttpResponse ¶
type HttpResponse struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
func (*HttpResponse) Byte ¶
func (h *HttpResponse) Byte() []byte
type InitDeployParam ¶
type InitDeployParam struct { AgentManagerRemoteIp string `json:"agentManagerRemoteIp"` Config []*AgentManagerTable `json:"config"` }
type ManagerConfig ¶
type ProcessConfig ¶
type ProcessObj ¶
type ProcessObj struct { Pid int `json:"pid"` Guid string `json:"guid"` Name string `json:"name"` Port int `json:"port"` Cmd string `json:"cmd"` RunCmd string `json:"run_cmd"` StartTime time.Time `json:"start_time"` StopTime time.Time `json:"stop_time"` Retry int `json:"retry"` Path string `json:"path"` Status string `json:"status"` Deploy bool `json:"deploy"` ConfigHash string `json:"config_hash"` Lock *sync.RWMutex Process *os.Process }
Click to show internal directories.
Click to hide internal directories.