client

package
v0.0.0-...-be4573e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: MulanPSL-2.0 Imports: 18 Imported by: 3

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: zhanghan <zhanghan@kylinos.cn> * Date: Thu Aug 07 16:18:53 2025 +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: 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: Thu Aug 07 17:35:12 2025 +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 Aug 06 17:35:12 2025 +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 Aug 06 17:35:12 2025 +0800

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommandResultHandler

func RunCommandResultHandler(c *gin.Context)

func TagsHandler

func TagsHandler(c *gin.Context)

Types

type CallbackHandler

type CallbackHandler struct {
	RunCommandCallback RunCommandCallback
	TaskLen            int
}

type Client

type Client struct {
	Registry registry.Registry

	// 用于event消息处理
	EventChan        chan *common.EventMessage
	EventCallbackMap map[int]common.EventCallback
	// contains filtered or unexported fields
}

func NewClient

func NewClient(serviceName string, reg registry.Registry) (*Client, error)

func (*Client) ApplyConfig

func (c *Client) ApplyConfig(batch *common.Batch, path, content string) error

func (*Client) BatchList

func (c *Client) BatchList() ([]*common.BatchList, error)

func (*Client) BatchUUIDList

func (c *Client) BatchUUIDList(batchId string) ([]string, error)

func (*Client) FileUpload

func (client *Client) FileUpload(filePath string, filename string) error

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 (c *Client) OnGetTags(callback GetTagsCallback)

func (*Client) ProcessCommandResult

func (c *Client) ProcessCommandResult(command_result *common.AsyncCmdResult)

func (*Client) RegisterHandlers

func (cli *Client) RegisterHandlers(router *gin.Engine)

RegisterHandlers 注册一些插件标准的API接口,清单如下:

func (*Client) RunCommand

func (c *Client) RunCommand(batch *common.Batch, cmd string) ([]*common.CmdResult, error)

func (*Client) RunCommandAsync

func (c *Client) RunCommandAsync(batch *common.Batch, cmd string, callback RunCommandCallback) error

func (*Client) RunScript

func (c *Client) RunScript(batch *common.Batch, script string, params []string) ([]*common.CmdResult, error)

func (*Client) ServiceStatus

func (c *Client) ServiceStatus(batch *common.Batch, servicename string) ([]*common.ServiceResult, error)

func (*Client) StartService

func (c *Client) StartService(batch *common.Batch, serviceName string) ([]*common.ServiceResult, error)

func (*Client) StopService

func (c *Client) StopService(batch *common.Batch, serviceName string) ([]*common.ServiceResult, error)

type GetTagsCallback

type GetTagsCallback func([]string) []common.Tag

type RunCommandCallback

type RunCommandCallback func([]*common.CmdResult)

type ScriptStruct

type ScriptStruct struct {
	Batch  *common.Batch `json:"batch"`
	Script string        `json:"script"`
	Params []string      `json:"params"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL