Documentation
¶
Index ¶
- Variables
- type Alarm
- type CPUUseRate
- type ContainerPerformance
- type ContainerReNameArg
- type ContainerTopResult
- type DiskInfo
- type DiskUseInfo
- type DockerContainerDeploy
- type DockerContainerRmArg
- type DockerContainerRmRse
- type DockerImageRunArg
- type DockerImageRunRse
- type DockerPauseArg
- type DockerPauseRse
- type DockerPullArg
- type DockerPullResult
- type DockerRestartArg
- type DockerRestartRse
- type DockerRmiArg
- type DockerRmiRse
- type DockerRunArg
- type DockerRunResult
- type DockerStopArg
- type DockerStopRse
- type EnvDeployedCheckArg
- type EnvDeployedCheckRse
- type ExecutableDeployArg
- type ExecutableDeployTask
- type ExecutableFile
- type ExecutableKillArg
- type ExecutableKillRse
- type ExecutableProcess
- type ExecutableRunStateArg
- type ExecutableRunStateRse
- type FileInfo
- type FileStructure
- type GatewayArg
- type GatewayBase
- type GetSlavePathInfoArg
- type GetSlavePathInfoRse
- type HostInfo
- type HttpsProxy
- type InstallDockerRse
- type InstallNginxRse
- type MemInfo
- type MonitorRule
- type NetWorkIO
- type Operate
- type PortInfo
- type ProcMemInfo
- type ProcessArg
- type ProcessBaseInfo
- type ProcessInfo
- type ProcessKillArg
- type ProjectDocker
- type ProjectExecutable
- type ProjectExecutableRunArg
- type ProjectExecutableRunRse
- type ProxyHttpCreateArg
- type ProxyHttpCreateRse
- type ProxyHttpUpdateArg
- type ProxyHttpUpdateRse
- type ProxySocket5UpdateArg
- type ProxySocket5UpdateRse
- type RegisterIpToGatewayArg
- type RegisterIpUpdateArg
- type RemoveDockerRse
- type RemoveNginxRse
- type SlaveHostsArg
- type SlaveHostsRse
- type SlavePerformance
- type Socket5Proxy
- type Socket5ProxyCreateArg
- type Socket5ProxyCreateRse
- type SoftwareDeployedCheck
- type TCPForward
- type TCPForwardCreateArg
- type TCPForwardCreateRse
- type TCPForwardUpdateArg
- type TCPForwardUpdateRse
- type Task
- type UpdateDockerImageArg
- type User
- type UserWhite
Constants ¶
This section is empty.
Variables ¶
var ( MonitorRuleMaxCPUDefault int = 30 MonitorRuleMaxMemDefault int = 60 MonitorRuleMaxDiskDefault int = 60 MonitorRuleMaxTxDefault int = 10 MonitorRuleMaxRxDefault int = 10 MonitorRuleMaxConnectNumDefault int = 100 )
监控规则 默认值, 没有设置则取默认值
Functions ¶
This section is empty.
Types ¶
type ContainerPerformance ¶
type ContainerPerformance struct {
ContainerId string
Date string
CPU string // 使用率
MEM string // 使用率
MEMUsage string
MEMLimit string
Tx string // 网络tx
Rx string // 网络rx
}
ContainerPerformance container performance
type ContainerReNameArg ¶
ContainerReNameArg container rename
type ContainerTopResult ¶
type ContainerTopResult struct {
Data container.ContainerTopOKBody
Err error
}
ContainerTopResult container top
type DiskInfo ¶
type DiskInfo struct {
DiskName string
DistType string
DistTotalMB string
DistUse *DiskUseInfo
}
DiskInfo 磁盘信息
type DiskUseInfo ¶
DiskUseInfo 磁盘使用的信息
type DockerContainerDeploy ¶
type DockerContainerDeploy struct {
Slave string
Project string
ContainerId string
TaskID string
Port map[string]string
}
DockerContainerDeploy docker container deploy
type DockerContainerRmArg ¶
type DockerContainerRmArg struct {
IsProject string // 1:是项目 0:不是
Slave string
Project string
ContainerId string
TaskID string
}
DockerContainerRmArg docker container rm
type DockerContainerRmRse ¶
type DockerContainerRmRse struct {
IsProject string // 1:是项目 0:不是
Slave string
Project string
ContainerId string
TaskId string
Rse string
}
DockerContainerRmRse docker container rm
type DockerImageRunArg ¶
type DockerImageRunArg struct {
ImageId string
RandomPort int // 0 false 1 true
PortRelation map[string]string
Name string
Env []string
TaskId string
IsProject bool
Project string
IsAlways bool
}
DockerImageRunArg docker image run
type DockerImageRunRse ¶
DockerImageRunRse 结果
type DockerPauseArg ¶
DockerPauseArg docker pause arg
type DockerPauseRse ¶
DockerPauseRse docker pause rse
type DockerPullArg ¶
DockerPullArg docker pull
type DockerPullResult ¶
DockerPullResult docker pull
type DockerRestartArg ¶
DockerRestartArg docker restart arg
type DockerRestartRse ¶
DockerRestartRse docker restart rse
type DockerRmiArg ¶
DockerRmiArg docker rmi arg
type DockerRmiRse ¶
DockerRmiRse docker rmi rse
type DockerRunArg ¶
type DockerRunArg struct {
Image string
ImageUser string
ImagePass string
RandomPort int // 0 false 1 true 是否随机端口
PortRelation map[string]string // 端口映射
Name string
Env []string
TaskId string
IsProject bool // 是否属于项目
Project string
IsAlways bool // 是否 always
}
DockerRunArg docker run
type DockerRunResult ¶
type DockerRunResult struct {
ID string
Warnings []string
Err error
TaskId string
IsProject bool
Project string
Port map[string]string
}
DockerRunResult docker run
type DockerStopArg ¶
DockerStopArg docker stop arg
type DockerStopRse ¶
DockerStopRse docker stop rse
type EnvDeployedCheckArg ¶
type EnvDeployedCheckArg struct {
Software []string // 软件名支持多个 如: docker;nginx;
}
EnvDeployedCheckArg 判断是否安装这些软件
type EnvDeployedCheckRse ¶
type EnvDeployedCheckRse struct {
SoftwareCheck []*SoftwareDeployedCheck
}
EnvDeployedCheckRse
type ExecutableDeployArg ¶
type ExecutableDeployArg struct {
Slave string // slave 地址 ip
DownloadFile string
Arg string
TaskId string
Note string
Cmd string
Env string
}
ExecutableDeployArg 部署可执行文件
type ExecutableDeployTask ¶
type ExecutableDeployTask struct {
Slave string // slave 地址 ip
TaskId string // 任務id
Command string // 執行的全部命令
Env string
ExecutableName string // 執行文件名 對應 ExecutableFile.Name
Arg string // 執行的參數
Time string
PID int
State string // 狀態
Note string // 備註
}
ExecutableDeployTask 可执行文件部署任务
type ExecutableFile ¶
type ExecutableFile struct {
Name string
FileName string
SaveFilePath string // 保存到磁盘的路径
Path string // 下载的路径
DirPath string // 解压的目录路径
Size string
OSType string
UploadTime string
Md5 string
FileID string // 文件名称md5
Cmd string // 可执行文件运行的命令
Env []string // 可执行文件运行的环境变量
}
ExecutableFile 可执行文件
type ExecutableKillArg ¶
ExecutableKillArg 可执行文件kill
type ExecutableKillRse ¶
ExecutableKillRse 可执行文件kill
type ExecutableProcess ¶
ExecutableProcess 可执行文件进程
type ExecutableRunStateArg ¶
ExecutableRunStateArg 可执行文件运行
type ExecutableRunStateRse ¶
ExecutableRunStateRse 可执行文件运行
type FileInfo ¶
type FileInfo struct {
Name string
Size int64
Mode int // 文件模式位
ModTime string // 修改时间
IsDir bool // 是否目录
Sys interface{} // 基础数据源(可以返回nil)
}
FileInfo 文件信息
type FileStructure ¶
FileStructure
type GatewayArg ¶
type GatewayArg struct {
Ports []string // 8080:80
ProjectName string // 绑定到的项目
LVS string // 负载均衡层级 L4 L7
LVSModel string // 负载均衡模式 random poll
}
GatewayArg 网关参数
type GatewayBase ¶
type GatewayBase struct {
Slave string // 部署在哪个主机上
Ports []string // 8080:80
ProjectName string // 绑定到的项目
LVS string // 负载均衡层级 L4 L7
LVSModel string // 负载均衡模式 random poll
IsClose string // 是否关闭 1:关闭
Create string // 创建时间
}
GatewayBase 网关基础参数
type GetSlavePathInfoArg ¶
GetSlavePathInfoArg 获取slave指定路径的目录结构与文件
type GetSlavePathInfoRse ¶
type GetSlavePathInfoRse struct {
Error string
Rse string
TaskId string
FileStructure []*FileStructure
}
GetSlavePathInfoRse
type HostInfo ¶
type HostInfo struct {
SlaveVersion string `json:"slave_version"`
// salve的ip地址
Slave string `json:"ip"`
//是否在线
SlaveOnline string `json:"online"`
HostName string `json:"host_name"`
//系统平台
SysType string `json:"sys_type"`
//系统版本 os_name+版号
OsName string `json:"os_name"`
OsNum string `json:"os_num"`
//系统架构
SysArchitecture string `json:"sys_architecture"`
//CPU核心数
CpuCoreNumber string `json:"cpu_core_number"`
//CPU name
CpuName string `json:"cpu_name"`
//CPU ID
CpuID string `json:"cpu_id"`
//主板ID
BaseBoardID string `json:"board_id"`
//内存总大小 MB
MemTotal string `json:"mem_totle"`
//磁盘信息
Disk []*DiskInfo `json:"disk"`
//磁盘总大小 MB
DiskTotal string `json:"disk_totle"`
// 当前CPU使用率
NowCPURate string `json:"now_cpu_rate"`
// 当前内存使用率
NowMEMRate string `json:"now_mem_rate"`
// 是否安装Docker
HasDocker string `json:"has_docker"`
// docker 版本
DockerVersion string `json:"docker_version"`
}
HostInfo host信息
type HttpsProxy ¶
type HttpsProxy struct {
Name string
Slave string
Port string
Create string
IsClose string // 是否关闭 0 否 1 是
Note string // 备注
IsDel string // 是否删除 0 否 1 是
}
HttpsProxy http/s 代理数据结构
type MemInfo ¶
type MemInfo struct {
//所有可用RAM大小 (即物理内存减去一些预留位和内核的二进制代码大小)
MemTotal int64 `json:"mem_total"`
//内存使用
MemUsed int64 `json:"mem_used"`
//LowFree与HighFree的总和,被系统留着未使用的内存
MemFree int64 `json:"mem_free"`
//用来给文件做缓冲大小
MemBuffers int64 `json:"mem_buffers"`
//被高速缓冲存储器(cache memory)用的内存的大小(等于diskcache minus SwapCache ).
MemCached int64 `json:"mem_cached"`
}
MemInfo 内存信息
type MonitorRule ¶
type MonitorRule struct {
Slave string
MaxCPU int // 允许最大cpu使用率,超过则报警
MaxMem int // 允许最大内存使用率,超过则报警
MaxDisk int // 允许最大磁盘使用率,超过则报警
MaxTx int // 允许最大网络TX,超过则报警
MaxRx int // 允许最大网络RX,超过则报警
MaxConnectNum int // 允许最大网络连接数,超过则报警
}
MonitorRule 监控规则
type PortInfo ¶
type PortInfo struct {
ProtoType string
LocalAddress string
ForeignAddress string
State string
PID string
PName string
}
PortInfo 端口信息
type ProcMemInfo ¶
type ProcMemInfo struct {
//所有可用RAM大小 (即物理内存减去一些预留位和内核的二进制代码大小)
MemTotal int64 `json:"mem_total"`
//内存使用
MemUsed int64 `json:"mem_used"`
//LowFree与HighFree的总和,被系统留着未使用的内存
MemFree int64 `json:"mem_free"`
//用来给文件做缓冲大小
MemBuffers int64 `json:"mem_buffers"`
//被高速缓冲存储器(cache memory)用的内存的大小(等于diskcache minus SwapCache ).
MemCached int64 `json:"mem_cached"`
}
ProcMemInfo 从 proc/meminfo 获取内存信息
type ProcessArg ¶
type ProcessArg struct {
Name string
Type int // 1:宿主机上的命令 2:可执行的二进制
TaskId string
Cmd string
Arg []string
}
ProcessArg 执行进程的参数
type ProcessBaseInfo ¶
type ProcessBaseInfo struct {
PID string `json:"pid"`
User string `json:"user"`
PName string `json:"pname"`
PPID string `json:"ppid"` //父进程
C string
Stime string
TTY string `json:"tty"`
Time string
CMD string `json:"cmd"` //执行命令
}
ProcessBaseInfo 进程基本信息 是兼容性的结构体 兼容了linux 和 windows
type ProcessInfo ¶
ProcessInfo 进程信息
type ProjectDocker ¶
type ProjectDocker struct {
Name string `json:"docker_name"` // 项目名称
Note string `json:"docker_note"` // 项目备注
IsGateway string `json:"docker_is_gateway"` // 是否启动网关 0不启动, 1启动
Port string `json:"docker_port"` // 占用端口
Image string `json:"docker_image"` // 镜像
User string `json:"docker_user"` // 账号
Password string `json:"docker_password"` // 密码
Env string `json:"docker_env"` // 环境变量
Duplicate string `json:"docker_duplicate"` // 副本数量
CreateTime string `json:"create_time"`
GatewaySlave string `json:"gateway_slave"`
GatewayPort string `json:"gateway_port"`
UpdateTime string `json:"update_time"`
}
ProjectDocker docker容器项目
type ProjectExecutable ¶
type ProjectExecutable struct {
Name string `json:"executable_name"` // 项目名称
Note string `json:"executable_note"` // 项目备注
Port string `json:"executable_port"` // 占用端口
Cmd string `json:"executable_cmd"` // 执行命令
Env string `json:"executable_env"` // 环境变量
Duplicate string `json:"executable_duplicate"` // 副本数量
Sys string `json:"executable_sys"` // 运行平台
Path string `json:"executable_dir"` // 可执行文件项目的目录
ZipFilePath string `json:"executable_zip"` // 可执行文件项目的压缩文件
CreateTime string `json:"create_time"`
}
ProjectExecutable 物理机可执行文件项目
type ProjectExecutableRunArg ¶
type ProjectExecutableRunArg struct {
ProjectName string
Slave string
Port string
Env string
TaskId string
Cmd string
}
ProjectExecutableRunArg 部署并运行物理机可执行文件项目参数
type ProjectExecutableRunRse ¶
type ProjectExecutableRunRse struct {
ProjectName string
Slave string
TaskId string
Pid string
Cmd string
}
ProjectExecutableRunRse 部署并运行物理机可执行文件项目结果返回
type ProxyHttpCreateArg ¶
ProxyHttpCreateArg 部署一个http/s代理
type ProxyHttpCreateRse ¶
type ProxyHttpCreateRse struct {
Name string
Slave string
Port string
Note string
TaskId string
Error string
Rse string
}
ProxyHttpCreateRse
type ProxyHttpUpdateArg ¶
type ProxyHttpUpdateArg struct {
Name string // 代理名称
UpdateType string // 修改的字段名
Vlaue string // 修改的值
TaskId string
}
ProxyHttpUpdateArg http/s 代理修改
type ProxyHttpUpdateRse ¶
ProxyHttpUpdateRse
type ProxySocket5UpdateArg ¶
type ProxySocket5UpdateArg struct {
Name string // 代理名称
UpdateType string // 修改的字段名
Vlaue string // 修改的值
TaskId string
}
ProxySocket5UpdateArg http/s 代理修改
type ProxySocket5UpdateRse ¶
ProxySocket5UpdateRse
type RegisterIpToGatewayArg ¶
RegisterIpToGatewayArg 注册地址到网关
type RegisterIpUpdateArg ¶
RegisterIpUpdateArg 通知网关更新
type SlaveHostsArg ¶
SlaveHostsArg 修改hosts文件
type SlavePerformance ¶
type SlavePerformance struct {
// CPU使用率
CPU *CPUUseRate
CPUCore []*CPUUseRate
// 内存使用率
MEM *ProcMemInfo
// 磁盘使用率
Disk []*DiskInfo
// 网络IO
NetWork []*NetWorkIO
// 连接数
ConnectNum int
TimeStamp string
}
SlavePerformance 心跳包上传健康信息
type Socket5Proxy ¶
type Socket5Proxy struct {
Name string
Slave string
Port string
Create string
IsClose string // 是否关闭 0 否 1 是
Note string // 备注
IsDel string // 是否删除 0 否 1 是
}
Socket5Proxy socket5 代理数据结构
type Socket5ProxyCreateArg ¶
type Socket5ProxyCreateArg struct {
Name string
Slave string
Port string
Note string
TaskId string
}
Socket5ProxyCreateArg
type Socket5ProxyCreateRse ¶
type Socket5ProxyCreateRse struct {
Name string
Slave string
Port string
Note string
TaskId string
Error string
Rse string
}
Socket5ProxyCreateRse
type SoftwareDeployedCheck ¶
SoftwareDeployedCheck
type TCPForward ¶
type TCPForward struct {
Name string
Slave string
Port string
Create string
Note string
ForwardTable []string // 转发表
IsClose string // 是否关闭 0 否 1 是
IsDel string // 是否删除 0 否 1 是
}
TCPForward tcpforward tcp网络转发
type TCPForwardCreateArg ¶
type TCPForwardCreateArg struct {
Name string
Slave string
Port string
Note string
ForwardTable []string // 转发表
TaskId string
}
TCPForwardCreateArg tcp 转发 参数
type TCPForwardCreateRse ¶
type TCPForwardCreateRse struct {
Name string
Slave string
Port string
Note string
ForwardTable []string // 转发表
TaskId string
Error string
Rse string
}
TCPForwardCreateRse tcp 转发 参数
type TCPForwardUpdateArg ¶
type TCPForwardUpdateArg struct {
Name string // 转发名称
UpdateType string // 修改的字段名
Vlaue string // 修改的值
TaskId string
}
TCPForwardUpdateArg tcp 转发修改
type TCPForwardUpdateRse ¶
TCPForwardUpdateRse
type Task ¶
type Task struct {
ID string
IP string
Result interface{} // 任务日志等等
State int // 1: 进行中, 2: 完成, 3: 中断
StateStr string
Create string // 任务创建时间
Note string // 任务描述
}
Task
type UpdateDockerImageArg ¶
type UpdateDockerImageArg struct {
Arg DockerRunArg
ContainerIds []string
}
UpdateDockerImageArg docker容器项目更新镜像传入参数