plugin

package
v0.0.0-...-269099d Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(c *gin.Context)

@Summary plugin add @Tags Plugin @Description 新增 @Produce json @Security token @Param plugin body rule.Plugin true "plugin" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/ [post]

func Delete

func Delete(c *gin.Context)

@Summary plugin delete @Tags Plugin @Description 删除 @Produce json @Security token @Param id path int true "ID" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/{id}/ [delete]

func Detail

func Detail(c *gin.Context)

@Summary plugin detail @Tags Plugin @Description 详情 @Produce json @Security token @Param id path int true "ID" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/{id}/ [get]

func DownloadYaml

func DownloadYaml(c *gin.Context)

@Summary download yaml @Tags Plugin @Description 下载yaml @Security token @Param run body DownloadSwigger true "json_poc" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/download/ [post]

func Get

func Get(c *gin.Context)

@Summary plugin list @Tags Plugin @Description 列表 @Produce json @Security token @Param page query int true "Page" @Param pagesize query int true "Pagesize" @Param object query db.PluginSearchField false "field" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/ [get]

func Run

func Run(c *gin.Context)

@Summary plugin run @Tags Plugin @Description 运行 @Produce json @Security token @Param run body RunSwigger false "run" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/run/ [post]

func SliceToMap

func SliceToMap(slice yaml.MapSlice) map[string]string

func Update

func Update(c *gin.Context)

@Summary plugin update @Tags Plugin @Description 更新 @Produce json @Security token @Param id path int true "ID" @Param plugin body rule.Plugin true "plugin" @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/{id}/ [put]

func UploadYaml

func UploadYaml(c *gin.Context)

@Summary upload yaml @Tags Plugin @Description 上传yaml @Accept multipart/form-data @Param yaml formData file true "file" @accept json @Security token @Success 200 {object} msg.Response @Failure 200 {object} msg.Response @Router /api/v1/poc/upload/ [post]

Types

type DownloadSerializer

type DownloadSerializer struct {
	// 下载 yaml
	JsonPoc datatypes.JSON `json:"json_poc"`
}

type DownloadSwigger

type DownloadSwigger struct {
	JsonPoc rule.Plugin `gorm:"column:json_poc" json:"json_poc"`
}

这个结构体没用 只是为了定义 swigger 前端的参数

type RunSerializer

type RunSerializer struct {
	// 运行单个
	Target  string         `json:"target" binding:"required"`
	VulId   string         `json:"vul_id"`
	Affects string         `json:"affects" binding:"required"`
	JsonPoc datatypes.JSON `json:"json_poc"`
}

type RunSwigger

type RunSwigger struct {
	Target  string      `json:"target"`
	VulId   string      `json:"vul_id"`
	Affects string      `gorm:"column:affects" json:"affects"`
	JsonPoc rule.Plugin `gorm:"column:json_poc" json:"json_poc"`
}

这个结构体没用 只是为了定义 swigger 前端的参数

type Serializer

type Serializer struct {
	// 返回给前端的字段
	DespName    string         `json:"desp_name"`
	Id          int            `json:"id"`
	VulId       string         `json:"vul_id"`
	Affects     string         `json:"affects"`
	JsonPoc     datatypes.JSON `json:"json_poc"`
	Enable      bool           `json:"enable"`
	Description int            `json:"description"`
}

type TempPoc

type TempPoc struct {
	Params []string               `json:"params"`
	Name   string                 `json:"name"`
	Set    map[string]string      `json:"set"`
	Rules  []rule.Rule            `json:"rules"`
	Groups map[string][]rule.Rule `json:"groups"`
	Detail rule.Detail            `json:"detail"`
}

Jump to

Keyboard shortcuts

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