Documentation
¶
Overview ¶
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Fri Jan 19 11:08:30 2024 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie <wubijie@kylinos.cn> * Date: Wed Dec 27 19:38:17 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Gzx1999 <guozhengxin@kylinos.cn> * Date: Tue Nov 7 15:01:17 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Tue Mar 12 15:33:09 2024 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Mon Dec 18 10:57:09 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie <wubijie@kylinos.cn> * Date: Thu Jan 11 20:24:26 2024 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800
Index ¶
- Constants
- func ReverseProxyHandler(c *gin.Context)
- type CallbackHandler
- type Client
- func (c *Client) ApplyConfig(batch *common.Batch, path, content string) error
- func (c *Client) BatchList() ([]*common.BatchList, error)
- func (c *Client) BatchUUIDList(batchId string) ([]string, error)
- func (client *Client) FileUpload(filePath string, filename string) error
- func (c *Client) GetPlugins() ([]*PluginInfo, error)
- func (c *Client) HasPermission(resource, operate string) (bool, error)
- func (client *Client) IsBind() bool
- func (c *Client) MachineInfoByUUID(machine_uuid string) (*common.MachineNode, error)
- func (c *Client) MachineList() ([]*common.MachineNode, error)
- func (client *Client) OnGetTags(callback GetTagsCallback)
- func (c *Client) ProcessCommandResult(command_result *common.AsyncCmdResult)
- func (c *Client) RegisterExtention(exts []common.Extention)
- func (client *Client) RegisterHandlers(router *gin.Engine)
- func (c *Client) RegisterPermission(pers []common.Permission) error
- func (c *Client) RunCommand(batch *common.Batch, cmd string) ([]*common.CmdResult, error)
- func (c *Client) RunCommandAsync(batch *common.Batch, cmd string, callback RunCommandCallback) error
- func (c *Client) RunScript(batch *common.Batch, script string, params []string) ([]*common.CmdResult, error)
- func (client *Client) Server() string
- func (c *Client) ServiceStatus(batch *common.Batch, servicename string) ([]*common.ServiceResult, error)
- func (c *Client) StartService(batch *common.Batch, serviceName string) ([]*common.ServiceResult, error)
- func (c *Client) StopService(batch *common.Batch, serviceName string) ([]*common.ServiceResult, error)
- func (c *Client) Wait4Bind()
- type GetTagsCallback
- type PluginFullInfo
- type PluginInfo
- type PluginStatus
- type RunCommandCallback
- type ScriptStruct
Constants ¶
const TokenCookie = "PluginToken"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallbackHandler ¶
type CallbackHandler struct { RunCommandCallback RunCommandCallback TaskLen int }
type Client ¶
type Client struct { PluginInfo *PluginInfo // 用于event消息处理 EventChan chan *common.EventMessage EventCallbackMap map[int]common.EventCallback // contains filtered or unexported fields }
func DefaultClient ¶
func DefaultClient(desc *PluginInfo) *Client
func (*Client) ApplyConfig ¶
func (*Client) FileUpload ¶
func (*Client) GetPlugins ¶
func (c *Client) GetPlugins() ([]*PluginInfo, error)
func (*Client) HasPermission ¶
func (*Client) MachineInfoByUUID ¶
func (c *Client) MachineInfoByUUID(machine_uuid string) (*common.MachineNode, error)
func (*Client) MachineList ¶
func (c *Client) MachineList() ([]*common.MachineNode, error)
func (*Client) OnGetTags ¶
func (client *Client) OnGetTags(callback GetTagsCallback)
func (*Client) ProcessCommandResult ¶
func (c *Client) ProcessCommandResult(command_result *common.AsyncCmdResult)
func (*Client) RegisterHandlers ¶
RegisterHandlers 注册一些插件标准的API接口,清单如下: GET /plugin_manage/info
func (*Client) RegisterPermission ¶
func (c *Client) RegisterPermission(pers []common.Permission) error
func (*Client) RunCommand ¶
func (*Client) RunCommandAsync ¶
func (*Client) RunScript ¶
func (*Client) ServiceStatus ¶
func (*Client) StartService ¶
func (*Client) StopService ¶
type PluginFullInfo ¶
type PluginFullInfo struct { PluginInfo Extentions []common.Extention Permissions []common.Permission }
用于插件与PilotGo server通讯
type PluginInfo ¶
type PluginInfo struct { MenuName string `json:"menuName"` Name string `json:"name"` Version string `json:"version"` Description string `json:"description"` Author string `json:"author"` Email string `json:"email"` Url string `json:"url"` Icon string `json:"icon"` PluginType string `json:"plugin_type"` ReverseDest string `json:"reverse_dest"` }
用于初始化Client