payload

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrHostParseEmpty = "parse host array empty"
	RespTypeMsg       = "msg"
	RespTypeError     = "error"
	RespTypeData      = "data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdParams

type CmdParams struct {
	Id   int    `form:"id" binding:"required"`
	Sudo bool   `form:"sudo"`
	Type string `form:"type" binding:"required"`
	Cmd  string `form:"cmd" binding:"required"`
}

type DeleteCmdHistoryParam

type DeleteCmdHistoryParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeleteGroupParam

type DeleteGroupParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeleteHostParam

type DeleteHostParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeleteJobParam

type DeleteJobParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeletePlayBookParam

type DeletePlayBookParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeletePrivateKeyParam

type DeletePrivateKeyParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeleteQuicklyCommandParam

type DeleteQuicklyCommandParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeleteTagParam

type DeleteTagParam struct {
	Id int `uri:"id" binding:"required"`
}

type DeleteTaskInstanceFrom

type DeleteTaskInstanceFrom struct {
	JobId     int   `form:"job_id"`
	TimeStamp int64 `form:"time_stamp"`
}

type DeleteTunnelParam

type DeleteTunnelParam struct {
	Id int `uri:"id" binding:"required"`
}

type File

type File struct {
	Name      string `json:"name"`
	Size      int64  `json:"size"`
	CachePath string `json:"cache_path"`
	Status    bool   `json:"status"`
}

type FileTaskCancelForm

type FileTaskCancelForm struct {
	Addr string `form:"addr" binding:"required"`
	File string `form:"file" binding:"required"`
}

type GetAllHostParam

type GetAllHostParam struct {
	Page
}

type GetGroupParam

type GetGroupParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetHostParam

type GetHostParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetJobParam

type GetJobParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetJobsParam

type GetJobsParam struct {
	ExecuteId int `form:"execute_id"`
}

type GetPlayBookParam

type GetPlayBookParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetPrivateKeyParam

type GetPrivateKeyParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetQuicklyCommandParam

type GetQuicklyCommandParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetTagParam

type GetTagParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetTaskInstanceLogParam

type GetTaskInstanceLogParam struct {
	Id int `form:"id" binding:"required"`
}

type GetTaskInstanceParam

type GetTaskInstanceParam struct {
	Page
	JobId int `form:"job_id"`
}

type GetTunnelParam

type GetTunnelParam struct {
	Id int `uri:"id" binding:"required"`
}

type GetTunnelsParam

type GetTunnelsParam struct {
	HostId int `form:"host_id"`
}

type ImportResponse

type ImportResponse struct {
	CreateGroup      []string `json:"create_group"`
	CreateTag        []string `json:"create_tag"`
	CreateHost       []string `json:"create_host"`
	CreatePrivateKey []string `json:"create_private_key"`
}

type MkdirParams

type MkdirParams struct {
	OptionsFileParams
	Dir string `form:"dir" binding:"required"`
}

type ModifyFileParams

type ModifyFileParams struct {
	Id            string `json:"id"`
	HostId        int    `json:"host_id" binding:"required"`
	ModifyContent string `json:"modify_content"`
}

ModifyFileParams 解析修改文件接口使用

type OptionsFileParams

type OptionsFileParams struct {
	Id     string `form:"id"`
	HostId int    `form:"host_id" binding:"required"`
}

type OptionsJobForm

type OptionsJobForm struct {
	Id int `form:"id" binding:"required"`
}

type Page

type Page struct {
	PageNum  int `form:"page_num"`
	PageSize int `form:"page_size"`
}

type PageData

type PageData struct {
	Total   int64       `json:"total"`
	PageNum int         `json:"page_num"`
	Data    interface{} `json:"data"`
}

type PostGroupForm

type PostGroupForm struct {
	Name   string `form:"name" binding:"required"`
	Params string `form:"params"`
	Mode   int    `form:"mode"`
}

type PostHostForm

type PostHostForm struct {
	HostName     string `form:"hostname" binding:"required"`
	User         string `form:"user" binding:"required"`
	Addr         string `form:"addr" binding:"required,ip_addr|hostname"`
	Port         int    `form:"port" binding:"required,min=0,max=65535"`
	PassWord     string `form:"password"`
	Group        int    `form:"group"`
	PrivateKeyId int    `form:"private_key_id" binding:"required_without=PassWord"`
	Tags         string `form:"tags"`
	VNCPort      int    `form:"vnc_port"`
}

type PostJobForm

type PostJobForm struct {
	Name        string `form:"name" binding:"required"`
	Type        string `form:"type" binding:"required"`
	Spec        string `form:"spec"`
	Cmd         string `form:"cmd"`
	CmdId       int    `form:"cmd_id"`
	CmdType     string `form:"cmd_type" binding:"required"`
	ExecuteID   int    `form:"execute_id" binding:"required"`
	ExecuteType string `form:"execute_type" binding:"required"`
}

type PostPlayBookForm

type PostPlayBookForm struct {
	Name  string `form:"name" binding:"required"`
	Steps string `form:"steps" binding:"required"`
}

type PostPrivateKeyForm

type PostPrivateKeyForm struct {
	Name       string                `form:"name" binding:"required"`
	Passphrase string                `form:"passphrase"`
	KeyFile    *multipart.FileHeader `form:"key_file" binding:"required"`
}

type PostQuicklyCommandForm

type PostQuicklyCommandForm struct {
	Name     string `form:"name" binding:"required"`
	Cmd      string `form:"cmd" binding:"required"`
	AppendCR bool   `form:"append_cr"`
}

type PostTagForm

type PostTagForm struct {
	Name string `form:"name" binding:"required"`
}

type PostTunnelForm

type PostTunnelForm struct {
	Mode        string `form:"mode" binding:"required"`
	Source      string `form:"source" binding:"required,hostname_port"`
	Destination string `form:"destination" binding:"required,hostname_port"`
	HostId      int    `form:"host_id" binding:"required"`
}

type PutGroupForm

type PutGroupForm struct {
	Id     int    `form:"id" binding:"required"`
	Name   string `form:"name"`
	Params string `form:"params"`
	Mode   int    `form:"mode"`
}

type PutHostForm

type PutHostForm struct {
	Id           int    `form:"id" binding:"required"`
	HostName     string `form:"hostname"`
	User         string `form:"user"`
	Addr         string `form:"addr" binding:"len=0|ip_addr|hostname"`
	Port         int    `form:"port" binding:"min=0,max=65535"`
	PassWord     string `form:"password"`
	Group        int    `form:"group"`
	PrivateKeyId int    `form:"private_key_id"`
	Tags         string `form:"tags"`
	VNCPort      int    `form:"vnc_port"`
}

type PutJobForm

type PutJobForm struct {
	Id          int    `form:"id" binding:"required"`
	Name        string `form:"name"`
	Type        string `form:"type"`
	Spec        string `form:"spec"`
	Cmd         string `form:"cmd"`
	CmdId       int    `form:"cmd_id"`
	CmdType     string `form:"cmd_type"`
	ExecuteID   int    `form:"execute_id"`
	ExecuteType string `form:"execute_type"`
}

type PutPlayBookForm

type PutPlayBookForm struct {
	Id    int    `form:"id" binding:"required"`
	Name  string `form:"name"`
	Steps string `form:"steps"`
}

type PutPrivateKeyForm

type PutPrivateKeyForm struct {
	Id         int                   `form:"id" binding:"required"`
	Name       string                `form:"name"`
	Passphrase string                `form:"passphrase"`
	KeyFile    *multipart.FileHeader `form:"key_file"`
}

type PutQuicklyCommandForm

type PutQuicklyCommandForm struct {
	Id       int    `form:"id" binding:"required"`
	Name     string `form:"name"`
	Cmd      string `form:"cmd"`
	AppendCR bool   `form:"append_cr"`
}

type PutTagForm

type PutTagForm struct {
	Id   int    `form:"id" binding:"required"`
	Name string `form:"name"`
}

type PutTunnelForm

type PutTunnelForm struct {
	Id          int    `form:"id" binding:"required"`
	Mode        string `form:"mode"`
	Source      string `form:"source" binding:"len=0|hostname_port"`
	Destination string `form:"destination" binding:"len=0|hostname_port"`
	HostId      int    `form:"host_id" binding:"required"`
}

type Response

type Response struct {
	Code string      `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data,omitempty"`
	Type string      `json:"type"` // data msg error
}

func GenerateDataResponse

func GenerateDataResponse(code string, msg string, data interface{}) Response

func GenerateErrorResponse

func GenerateErrorResponse(code string, msg string) Response

func GenerateMsgResponse

func GenerateMsgResponse(code string, msg string) Response

type SearchCmdHistoryParams

type SearchCmdHistoryParams struct {
	KeyWord string `form:"keyword" binding:"required"`
	Limit   int    `form:"limit"`
}

type UploadResponse

type UploadResponse struct {
	Files []File `json:"files"`
}

Jump to

Keyboard shortcuts

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