Documentation ¶
Overview ¶
提供公共数据结构定义
Index ¶
- Constants
- func ToMessage(d string, s interface{}) error
- type AsyncCmdResult
- type Batch
- type BatchExtention
- type BatchList
- type CmdResult
- type CmdStruct
- type CommonResult
- type EventMessage
- type Extention
- type File
- type MDIPChange
- type MDPackageInstall
- type MDPackageUninstall
- type MDPackageUpdate
- type MachineExtention
- type MachineNode
- type NodeResult
- type PageExtention
- type Permission
- type Result
- type ServiceInfo
- type ServiceResult
- type ServiceStruct
- type Tag
Constants ¶
View Source
const ( // 主机安装软件包 MsgPackageInstall = 0 // 主机升级软件包 MsgPackageUpdate = 1 // 主机卸载软件包 MsgPackageUninstall = 2 // 主机ip变更 MsgIPChange = 3 // 平台新增主机 MsgHostAdd = 10 // 平台移除主机 MsgHostRemove = 11 // 插件添加 MsgPluginAdd = 20 // 插件卸载 MsgPluginRemove = 21 )
event消息类型定义
View Source
const ( // 单机/多机操作扩展,增加选择单机/多机时对机器的操作功能 ExtentionMachine = "machine" // 批处理扩展,增加选择批次时对批次的操作 ExtentionBatch = "batch" // 主页面扩展,增加侧边栏入口及主页面 ExtentionPage = "page" )
View Source
const ( ServiceActiveStatusRunning = "running" ServiceActiveStatusExited = "exited" ServiceActiveStatusWaiting = "waiting" ServiceActiveStatusInactive = "inactive" ServiceActiveStatusUnknown = "unknown" ServiceLoadedStatusEnabled = "enabled" ServiceLoadedStatusDisabled = "disabled" ServiceLoadedStatusStatic = "static" ServiceLoadedStatusMask = "mask" ServiceLoadedStatusUnknown = "unknown" )
View Source
const ( ServiceUnit = "service" SocketUnit = "socket" TargetUnit = "target" MountUnit = "mount" AutomountUnit = "automount" PathUnit = "path" TimeUnit = "time" )
View Source
const ( // 插件正在运行 StatusRunning = "running" // 插件已加载,但未运行 StatusLoaded = "loaded" // 插件离线,无法访问 StatusOffline = "offline" )
View Source
const ( TypeOk = "ok" TypeWarn = "warn" TypeError = "error" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AsyncCmdResult ¶
type BatchExtention ¶
type BatchExtention struct { Type string `json:"type"` Name string `json:"name"` URL string `json:"url"` Permission string `json:"permission"` }
func (*BatchExtention) Clone ¶
func (be *BatchExtention) Clone() Extention
type CommonResult ¶
type CommonResult struct { Code int `json:"code"` Message string `json:"msg"` Data json.RawMessage `json:"data"` }
func (*CommonResult) ParseData ¶
func (r *CommonResult) ParseData(d interface{}) error
type EventMessage ¶
type Extention ¶
type Extention interface {
Clone() Extention
}
func ParseParameters ¶
解析extentions参数
type MDIPChange ¶
type MDPackageInstall ¶
type MDPackageUninstall ¶
type MDPackageUpdate ¶
type MachineExtention ¶
type MachineExtention struct { Type string `json:"type"` Name string `json:"name"` URL string `json:"url"` Permission string `json:"permission"` }
func (*MachineExtention) Clone ¶
func (me *MachineExtention) Clone() Extention
type MachineNode ¶
type NodeResult ¶
type PageExtention ¶
type PageExtention struct { Type string `json:"type"` Name string `json:"name"` URL string `json:"url"` Permission string `json:"permission"` }
func (*PageExtention) Clone ¶
func (pe *PageExtention) Clone() Extention
type Permission ¶
type Result ¶
type Result struct { Code int `json:"code"` Mseeage string `json:"msg"` Data []*ServiceResult `json:"data"` }
type ServiceInfo ¶
type ServiceInfo struct { ServiceName string UnitName string UnitType string ServicePath string //配置文件放置的目录 ServiceAfter string //在什么服务启动后启动 ServiceBefore string //在什么服务启动前启动 ServiceRequires string //需要的daemon ServiceWants string //与requires相反 ServiceEnvironmentFile string //启动脚本的环境配置文件 ServiceExectStart string //实际执行daemon的指令或脚本程序 ServiceActiveStatus string ServiceLoadedStatus string StartTime string }
type ServiceResult ¶
type ServiceResult struct { MachineUUID string MachineIP string ServiceSample ServiceInfo }
type ServiceStruct ¶
Click to show internal directories.
Click to hide internal directories.