acspluginmanager

package
v0.0.0-...-5d04527 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// plugin type
	PLUGIN_ONCE    = 0
	PLUGIN_PERSIST = 1

	//plugin status
	PERSIST_RUNNING = "PERSIST_RUNNING"
	PERSIST_FAIL    = "PERSIST_FAIL"
	PERSIST_UNKNOWN = "PERSIST_UNKNOWN"
	ONCE_INSTALLED  = "ONCE_INSTALLED"
)
View Source
const (
	SUCCESS = 0

	CHECK_ENDPOINT_FAIL         = 1000 + iota // check end point fail
	PACKAGE_NOT_FOUND                         // 插件包未找到
	PACKAGE_FORMART_ERR                       // 插件包的格式错误,不是zip格式
	UNZIP_ERR                                 // 解压插件包时错误
	UNMARSHAL_ERR                             // 解析json文件时错误(config.json)
	PLUGIN_FORMAT_ERR                         // 插件格式错误,如config.json或者插件可执行文件缺失,插件与当前系统平台不适配等
	MD5_CHECK_FAIL                            // MD5校验失败
	DOWNLOAD_FAIL                             // 下载失败
	LOAD_INSTALLEDPLUGINS_ERR                 // 读取 installed_plugins文件错误
	DUMP_INSTALLEDPLUGINS_ERR                 // 保存内容到 installed_plugins文件错误
	GET_ONLINE_PACKAGE_INFO_ERR               // 获取线上的插件包信息时错误
	EXECUTABLE_PERMISSION_ERR                 // linux下赋予脚本可执行权限时错误
)

退出码

View Source
const (
	CHECK_ENDPOINT_FAIL_STR         = "CHECK_ENDPOINT_FAIL: "
	PACKAGE_NOT_FOUND_STR           = "PACKAGE_NOT_FOUND: "           // 插件包未找到
	PACKAGE_FORMART_ERR_STR         = "PACKAGE_FORMAT_ERR: "          // 插件包的格式错误,不是zip格式
	UNZIP_ERR_STR                   = "UNZIP_ERR: "                   // 解压插件包时错误
	UNMARSHAL_ERR_STR               = "UNMARSHAL_ERR: "               // 解析json文件时错误(config.json)
	PLUGIN_FORMAT_ERR_STR           = "PLUGIN_FORMAT_ERR: "           // 插件格式错误,如config.json或者插件可执行文件缺失,插件与当前系统平台不适配等
	MD5_CHECK_FAIL_STR              = "MD5_CHECK_FAIL: "              // MD5校验失败
	DOWNLOAD_FAIL_STR               = "DOWNLOAD_FAIL: "               // 下载失败
	LOAD_INSTALLEDPLUGINS_ERR_STR   = "LOAD_INSTALLEDPLUGINS_ERR: "   // 读取 installed_plugins文件错误
	DUMP_INSTALLEDPLUGINS_ERR_STR   = "DUMP_INSTALLEDPLUGINS_ERR: "   // 保存内容到 installed_plugins文件错误
	GET_ONLINE_PACKAGE_INFO_ERR_STR = "GET_ONLINE_PACKAGE_INFO_ERR: " // 获取线上的插件包信息时错误
	EXECUTABLE_PERMISSION_ERR_STR   = "EXECUTABLE_PERMISSION_ERR: "
)
View Source
const Separator = string(filepath.Separator)

Variables

View Source
var INSTALLEDPLUGINS string
View Source
var PLUGINDIR string

Functions

func FileProtocolDownload

func FileProtocolDownload(url, filePath string) error

Types

type InstalledPlugins

type InstalledPlugins struct {
	PluginList []pluginInfo `json:"pluginList"`
}

type ListRet

type ListRet struct {
	Code       int          `json:"code"`
	RequestId  string       `json:"requestId"`
	InstanceId string       `json:"instanceId"`
	PluginList []pluginInfo `json:"pluginList"`
}

type PluginManager

type PluginManager struct {
	Verbose bool
	Yes     bool
}

func NewPluginManager

func NewPluginManager(verbose bool) (*PluginManager, error)

func (*PluginManager) ExecutePlugin

func (pm *PluginManager) ExecutePlugin(file, pluginName, pluginId, params, separator, paramsV2, version string, local bool) (exitCode int, err error)

func (*PluginManager) List

func (pm *PluginManager) List(pluginName string, local bool) error

func (*PluginManager) ShowPluginStatus

func (pm *PluginManager) ShowPluginStatus() error

func (*PluginManager) VerifyPlugin

func (pm *PluginManager) VerifyPlugin(url, params, separator, paramsV2 string) (exitCode int, err error)

type WinDir

type WinDir string

func (WinDir) Open

func (d WinDir) Open(name string) (http.File, error)

针对windows的路径模式定义的FileSystem,参照net/http.Dir

Directories

Path Synopsis
thirdparty
json-iterator/go
Package jsoniter implements encoding and decoding of JSON as defined in RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json.
Package jsoniter implements encoding and decoding of JSON as defined in RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json.
shlex
Package shlex implements a simple lexer which splits input in to tokens using shell-style rules for quoting and commenting.
Package shlex implements a simple lexer which splits input in to tokens using shell-style rules for quoting and commenting.
table
Package table provides a convenient way to generate tabular output of any data, primarily useful for CLI tools.
Package table provides a convenient way to generate tabular output of any data, primarily useful for CLI tools.

Jump to

Keyboard shortcuts

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