service

package
v0.0.0-...-05e86ca Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsDebug bool

Functions

func AddPlugin

func AddPlugin(ctx *gin.Context)

func AlterPlugin

func AlterPlugin(ctx *gin.Context)

func ClearLogs

func ClearLogs(ctx *gin.Context)

func DelLog

func DelLog(ctx *gin.Context)

func DelLogByDate

func DelLogByDate(ctx *gin.Context)

func DelOldLog

func DelOldLog(ctx *gin.Context)

func DeleteLogs

func DeleteLogs(ctx *gin.Context)

func DeletePlugin

func DeletePlugin(ctx *gin.Context)

func Download

func Download(ctx *gin.Context)

func GetHosts

func GetHosts(ctx *gin.Context)

GetHosts 从control中的Survey中获取host信息

func GetLogDate

func GetLogDate(ctx *gin.Context)

func GetLogInfo

func GetLogInfo(ctx *gin.Context)

func GetLogLocate

func GetLogLocate(ctx *gin.Context)

func GetLogs

func GetLogs(ctx *gin.Context)

func GetPluginNameList

func GetPluginNameList(ctx *gin.Context)

func GetProductKey

func GetProductKey(ctx *gin.Context)

func GetTempConfig

func GetTempConfig(ctx *gin.Context)

func PluginAPI

func PluginAPI(ctx *gin.Context)

func PubPlugin

func PubPlugin(ctx *gin.Context)

PubPlugin PubPlugin 将插件发布到指定host中

func QueryPlugin

func QueryPlugin(ctx *gin.Context)

func RunPlugin

func RunPlugin(ctx *gin.Context)

func SetLicenseCode

func SetLicenseCode(ctx *gin.Context)

func SetRunType

func SetRunType(ctx *gin.Context)

func StopPlugin

func StopPlugin(ctx *gin.Context)

func TakeDown

func TakeDown(ctx *gin.Context)

TakeDown 将指定插件下架

func UpdateConfig

func UpdateConfig(ctx *gin.Context)
func LoadPlugin(ctx *gin.Context) {
	var plugin control.TPluginControl
	var err error
	var userID int32
	var userCode string
	ginContext := genService.NewGinContext(ctx)
	if userID, userCode, err = ginContext.CheckRequest(&plugin); err != nil {
		service.LogWriter.WriteError(fmt.Sprintf("Error while parsing request: %s", err.Error()), false)
		ginContext.Reply(response.Failure(err.Error()))
		return
	}
	plugin.OperatorID, plugin.OperatorCode = userID, userCode

	result := plugin.LoadPlugin()
	if IsDebug {
		strJson, _ := json.Marshal(result)
		service.LogWriter.WriteDebug(fmt.Sprintf("Load plugin: %s", string(strJson)), false)
	}
	ginContext.Reply(result)
}
func UnloadPlugin(ctx *gin.Context) {
	var plugin control.TPluginControl
	var err error
	var userID int32
	var userCode string
	ginContext := genService.NewGinContext(ctx)
	if userID, userCode, err = ginContext.CheckRequest(&plugin); err != nil {
		service.LogWriter.WriteError(fmt.Sprintf("Error while parsing request: %s", err.Error()), false)
		ginContext.Reply(response.Failure(err.Error()))
		return
	}
	plugin.OperatorID, plugin.OperatorCode = userID, userCode

	result := plugin.UnloadPlugin()
	if IsDebug {
		strJson, _ := json.Marshal(result)
		service.LogWriter.WriteDebug(fmt.Sprintf("Unload plugin: %s", string(strJson)), false)
	}
	ginContext.Reply(result)
}

func UpdatePluginFile

func UpdatePluginFile(ctx *gin.Context)

func Upload

func Upload(ctx *gin.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

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