buildin

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepNameCMD       = "cmd"
	StepNameShell     = "shell"
	StepNameFile      = "file"
	StepMultiNameFile = "multi_file"
	StepNameZipFile   = "zip"
	StepNameYamlJson  = "json_yaml"

	GUIDLength  = 36
	CMDName     = "name"
	CMDDesc     = "desc"
	CMDScheme   = "schema"
	CMDCommand  = "exec"
	ParamClient = "--client"
	ParamParams = "--params"

	GOOSWindows   = "windows"
	DefaultFileFs = fs.FileMode(0644)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStep

type BaseStep struct {
	// contains filtered or unexported fields
}

func (*BaseStep) Create

func (bs *BaseStep) Create() Step

func (*BaseStep) Desc

func (bs *BaseStep) Desc() string

func (*BaseStep) Exec

func (bs *BaseStep) Exec(*transport.Session) ([]byte, error)

func (*BaseStep) GetSchema

func (bs *BaseStep) GetSchema(instance Step) (interface{}, error)

func (*BaseStep) ID

func (bs *BaseStep) ID() string

func (*BaseStep) Name

func (bs *BaseStep) Name() string

func (*BaseStep) ParseCaches

func (bs *BaseStep) ParseCaches(instance Step) []string

func (*BaseStep) SetID

func (bs *BaseStep) SetID(id string)

type FileUploadStep

type FileUploadStep struct {
	BaseStep
	File    string `json:"file" jsonschema:"format=data-url"`
	Options string `` /* 153-byte string literal not displayed */
	Remote  string `json:"remote" jsonschema:"required=true" jsonschema_description:"远程文件路径"`
}

FileUploadStep 上传文件

func (*FileUploadStep) Create

func (bs *FileUploadStep) Create() Step

func (*FileUploadStep) Desc

func (bs *FileUploadStep) Desc() string

func (*FileUploadStep) Exec

func (bs *FileUploadStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*FileUploadStep) Name

func (bs *FileUploadStep) Name() string

type JsonYamlReplaceStep

type JsonYamlReplaceStep struct {
	BaseStep
	Path   string      `json:"path" jsonschema:"required=true" jsonschema_description:"例如: $.path1.path2[0].item"`
	Value  interface{} `` /* 149-byte string literal not displayed */
	Remote string      `json:"remote" jsonschema:"required=true" jsonschema_description:"远程Yaml/Json路径(不支持大文件)"`
}

JsonYamlReplaceStep 上传多个文件

func (*JsonYamlReplaceStep) Create

func (bs *JsonYamlReplaceStep) Create() Step

func (*JsonYamlReplaceStep) Desc

func (bs *JsonYamlReplaceStep) Desc() string

func (*JsonYamlReplaceStep) Exec

func (bs *JsonYamlReplaceStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*JsonYamlReplaceStep) GetSchema

func (bs *JsonYamlReplaceStep) GetSchema(instance Step) (interface{}, error)

func (*JsonYamlReplaceStep) Name

func (bs *JsonYamlReplaceStep) Name() string

type MultiFileUploadStep

type MultiFileUploadStep struct {
	BaseStep
	Files     []string `json:"files" jsonschema:"format=data-url,required=true"`
	RemoteDir string   `json:"remote_dir" jsonschema:"required=true" jsonschema_description:"远程文件夹路径"`
}

MultiFileUploadStep 上传多个文件

func (*MultiFileUploadStep) Create

func (bs *MultiFileUploadStep) Create() Step

func (*MultiFileUploadStep) Desc

func (bs *MultiFileUploadStep) Desc() string

func (*MultiFileUploadStep) Exec

func (bs *MultiFileUploadStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*MultiFileUploadStep) Name

func (bs *MultiFileUploadStep) Name() string

type PluginStep

type PluginStep struct {
	BaseStep
	Data       interface{}
	ScriptPath string
	// contains filtered or unexported fields
}

PluginStep 调用外部程序比如python或者go的脚本来获取输出 参数为连接的信息和插件模块的参数 插件需要提供Scheme 以供渲染表单

func (*PluginStep) Create

func (bs *PluginStep) Create() Step

func (*PluginStep) Desc

func (bs *PluginStep) Desc() string

func (*PluginStep) Exec

func (bs *PluginStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*PluginStep) GetSchema

func (bs *PluginStep) GetSchema(instance Step) (interface{}, error)

func (*PluginStep) MarshalJSON

func (bs *PluginStep) MarshalJSON() ([]byte, error)

func (*PluginStep) Name

func (bs *PluginStep) Name() string

func (*PluginStep) UnmarshalJSON

func (bs *PluginStep) UnmarshalJSON(data []byte) error

type RunCmdStep

type RunCmdStep struct {
	BaseStep
	Cmd string `json:"cmd" jsonschema:"required=true"`
}

RunCmdStep 执行cmd

func (*RunCmdStep) Create

func (bs *RunCmdStep) Create() Step

func (*RunCmdStep) Desc

func (bs *RunCmdStep) Desc() string

func (*RunCmdStep) Exec

func (bs *RunCmdStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*RunCmdStep) Name

func (bs *RunCmdStep) Name() string

type RunShellStep

type RunShellStep struct {
	BaseStep
	Shell string `json:"shell" jsonschema:"required=true"`
}

RunShellStep 执行shell

func (*RunShellStep) Create

func (bs *RunShellStep) Create() Step

func (*RunShellStep) Desc

func (bs *RunShellStep) Desc() string

func (*RunShellStep) Exec

func (bs *RunShellStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*RunShellStep) Name

func (bs *RunShellStep) Name() string

type Step

type Step interface {
	Exec(session *transport.Session, sudo bool) ([]byte, error)
	GetSchema(instance Step) (interface{}, error)
	Create() Step
	Name() string
	Desc() string
	ID() string
	SetID(id string)
	ParseCaches(instance Step) []string
}

type ZipFileStep

type ZipFileStep struct {
	BaseStep
	File   string `json:"file" jsonschema:"format=data-url" jsonschema_description:"*.tar | *.tar.gz | *.zip"`
	Remote string `json:"remote" jsonschema:"required=true" jsonschema_description:"解压到远端文件夹"`
}

ZipFileStep 上传多个文件

func (*ZipFileStep) Create

func (bs *ZipFileStep) Create() Step

func (*ZipFileStep) Desc

func (bs *ZipFileStep) Desc() string

func (*ZipFileStep) Exec

func (bs *ZipFileStep) Exec(session *transport.Session, sudo bool) ([]byte, error)

func (*ZipFileStep) Name

func (bs *ZipFileStep) Name() string

Jump to

Keyboard shortcuts

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