Documentation ¶
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) GetPluginInfo(name string) (*PluginInfo, error)
- func (c *Client) HasPermission(resource, operate string) (bool, error)
- func (client *Client) IsBind() bool
- func (c *Client) ListenEvent(eventTypes []int, callbacks []EventCallback) error
- 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) ProcessEvent(event *common.EventMessage)
- func (c *Client) PublishEvent(msg common.EventMessage) error
- 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) UnListenEvent(eventTypes []int) error
- func (c *Client) Wait4Bind()
- type EventCallback
- type GetTagsCallback
- type PluginFullInfo
- type PluginInfo
- type PluginStatus
- type RunCommandCallback
- type ScriptStruct
Constants ¶
View Source
const ( HeartbeatInterval = 30 * time.Second HeartbeatKey = "heartbeat:" )
View Source
const TokenCookie = "PluginToken"
Variables ¶
This section is empty.
Functions ¶
func ReverseProxyHandler ¶
Types ¶
type CallbackHandler ¶
type CallbackHandler struct { RunCommandCallback RunCommandCallback TaskLen int }
type Client ¶
type Client struct { PluginInfo *PluginInfo // contains filtered or unexported fields }
func DefaultClient ¶
func DefaultClient(desc *PluginInfo) *Client
func (*Client) ApplyConfig ¶
func (*Client) FileUpload ¶
func (*Client) GetPluginInfo ¶
func (c *Client) GetPluginInfo(name string) (*PluginInfo, error)
func (*Client) HasPermission ¶
func (*Client) ListenEvent ¶
func (c *Client) ListenEvent(eventTypes []int, callbacks []EventCallback) error
注册event事件监听
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) ProcessEvent ¶
func (c *Client) ProcessEvent(event *common.EventMessage)
func (*Client) PublishEvent ¶
func (c *Client) PublishEvent(msg common.EventMessage) error
发布event事件
func (*Client) RegisterExtention ¶
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) ServiceStatus ¶
func (*Client) StartService ¶
func (*Client) StopService ¶
type EventCallback ¶
type EventCallback func(e *common.EventMessage)
type GetTagsCallback ¶
type PluginFullInfo ¶
type PluginFullInfo struct { PluginInfo Extentions []common.Extention Permissions []common.Permission }
用于插件与PilotGo server通讯
type PluginInfo ¶
type PluginInfo struct { Name string `json:"name"` Version string `json:"version"` Description string `json:"description"` Author string `json:"author"` Email string `json:"email"` Url string `json:"url"` PluginType string `json:"plugin_type"` ReverseDest string `json:"reverse_dest"` }
用于初始化Client
type RunCommandCallback ¶
Click to show internal directories.
Click to hide internal directories.