action

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const STACK = "stack"

Variables

This section is empty.

Functions

func GetFiles

func GetFiles(workdir string, fuzzyPath []string, pathList []string) []string

Types

type ActionHandler

type ActionHandler interface {
	// Pre 执行前准备
	Pre() error

	// Hook 执行
	Hook() (*model.ActionResult, error)

	// Post 执行后清理 (无论执行是否成功,都应该有Post的清理)
	Post() error
}

ActionHandler 执行动作钩子

type AffectedFile added in v1.0.3

type AffectedFile struct {
	Filepath         string `json:"filepath"`
	FilepathRelative string `json:"filepath_relative"`
	Hightlights      []int  `json:"hightlights"`
	LineStart        int    `json:"line_start"`
	LineEnd          int    `json:"line_end"`
}

type AffectedFiles added in v1.0.3

type AffectedFiles struct {
	FilePath   string       `json:"filePath"`
	Text       string       `json:"text"`
	Range      Range        `json:"range"`
	Highlights []Highlights `json:"highlights"`
}

type ArtifactoryAction

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

ArtifactoryAction Storage building

func NewArtifactoryAction

func NewArtifactoryAction(step model2.Step, ctx context.Context, output *output.Output) *ArtifactoryAction

func (*ArtifactoryAction) ExecuteCommand added in v1.0.3

func (a *ArtifactoryAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*ArtifactoryAction) Hook

func (*ArtifactoryAction) Post

func (a *ArtifactoryAction) Post() error

func (*ArtifactoryAction) Pre

func (a *ArtifactoryAction) Pre() error

type BaseEntity added in v1.0.3

type BaseEntity struct {
	Id string `json:"id"`
}

type CQAffectedFile added in v1.0.3

type CQAffectedFile struct {
	Line       int64
	Column     int64
	Highlights []int64
}

type CQJson added in v1.0.3

type CQJson struct {
	Version string
	Success bool
	Message string
	Issues  map[string]Issue
}

type CheckAggregationAction

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

CheckAggregationAction 合约聚合

func NewCheckAggregationAction

func NewCheckAggregationAction(step model.Step, ctx context.Context, output *output.Output) *CheckAggregationAction

func (*CheckAggregationAction) Hook

func (*CheckAggregationAction) Post

func (a *CheckAggregationAction) Post() error

func (*CheckAggregationAction) Pre

func (a *CheckAggregationAction) Pre() error

type Choices added in v1.0.3

type Choices struct {
	Text         string `json:"text"`
	Index        uint   `json:"index"`
	FinishReason string `json:"finish_reason"`
}

type CreateProjectRes added in v1.0.3

type CreateProjectRes struct {
	Message string          `json:"message"`
	Data    MetaScanProject `json:"data"`
	Code    int64           `json:"code"`
}

type Detail added in v1.0.3

type Detail struct {
	Code          string
	Category      string
	Severity      string
	Title         string
	Description   string
	AffectedFiles CQAffectedFile
}

Detail 具体出现的问题

type DockerEnv

type DockerEnv struct {
	Image string
	// contains filtered or unexported fields
}

func NewDockerEnv

func NewDockerEnv(step model2.Step, ctx context.Context, output *output.Output) *DockerEnv

func (*DockerEnv) Hook

func (e *DockerEnv) Hook() (*model2.ActionResult, error)

func (*DockerEnv) Post

func (e *DockerEnv) Post() error

func (*DockerEnv) Pre

func (e *DockerEnv) Pre() error

type End added in v1.0.3

type End struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

type EslintAction added in v1.0.2

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

EslintAction 前端代码检查

func NewEslintAction added in v1.0.2

func NewEslintAction(step model.Step, ctx context.Context, output *output.Output) *EslintAction

func (*EslintAction) ExecuteCommand added in v1.0.2

func (a *EslintAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*EslintAction) Hook added in v1.0.2

func (a *EslintAction) Hook() (*model.ActionResult, error)

func (*EslintAction) Post added in v1.0.2

func (a *EslintAction) Post() error

func (*EslintAction) Pre added in v1.0.2

func (a *EslintAction) Pre() error

type EslintCheckResult added in v1.0.2

type EslintCheckResult struct {
	FilePath            string                     `json:"filePath"`
	Messages            []EslintCheckResultMessage `json:"messages"`
	SuppressedMessages  []interface{}              `json:"suppressedMessages"`
	ErrorCount          int                        `json:"errorCount"`
	FatalErrorCount     int                        `json:"fatalErrorCount"`
	WarningCount        int                        `json:"warningCount"`
	FixableErrorCount   int                        `json:"fixableErrorCount"`
	FixableWarningCount int                        `json:"fixableWarningCount"`
	UsedDeprecatedRules []interface{}              `json:"usedDeprecatedRules"`
}

type EslintCheckResultMessage added in v1.0.2

type EslintCheckResultMessage struct {
	RuleId    string      `json:"ruleId"`
	Severity  int         `json:"severity"`
	Message   string      `json:"message"`
	Line      int         `json:"line"`
	Column    int         `json:"column"`
	NodeType  interface{} `json:"nodeType"`
	MessageId string      `json:"messageId"`
}

type EthGasReporterAction added in v1.0.3

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

EthGasReporterAction EthGasReporter合约检查

func NewEthGasReporterAction added in v1.0.3

func NewEthGasReporterAction(step model.Step, ctx context.Context, output *output.Output) *EthGasReporterAction

func (*EthGasReporterAction) ExecuteCommand added in v1.0.3

func (a *EthGasReporterAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*EthGasReporterAction) Hook added in v1.0.3

func (*EthGasReporterAction) Post added in v1.0.3

func (a *EthGasReporterAction) Post() error

func (*EthGasReporterAction) Pre added in v1.0.3

func (a *EthGasReporterAction) Pre() error

type FormatMalwareWorkflowEngine added in v1.0.3

type FormatMalwareWorkflowEngine struct {
	MalwareWorkflowEngine
	ShowTitle   string `json:"showTitle"`
	Hightlights []int  `json:"hightlights"`
	LineStart   int    `json:"lineStart"`
	LineEnd     int    `json:"lineEnd"`
}

type FormatSecurityAnalyzerResult added in v1.0.3

type FormatSecurityAnalyzerResult struct {
	Filepath string                        `json:"filepath"`
	Mwe      []FormatMalwareWorkflowEngine `json:"mwe"`
	FileKey  string                        `json:"fileKey"`
}

type GitAction

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

GitAction git clone

func NewGitAction

func NewGitAction(step model2.Step, ctx context.Context, output *output.Output) *GitAction

func (*GitAction) ExecuteCommand

func (a *GitAction) ExecuteCommand(commands []string) (string, error)

func (*GitAction) ExecuteCommandDirect

func (a *GitAction) ExecuteCommandDirect(commands []string) (string, error)

func (*GitAction) ExecuteStringCommand

func (a *GitAction) ExecuteStringCommand(command string) (string, error)

func (*GitAction) Hook

func (a *GitAction) Hook() (*model2.ActionResult, error)

func (*GitAction) Post

func (a *GitAction) Post() error

func (*GitAction) Pre

func (a *GitAction) Pre() error

type Highlights added in v1.0.3

type Highlights struct {
	Start Start `json:"start"`
	End   End   `json:"end"`
}

type ICPDeployAction added in v1.0.3

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

ICPDeployAction Upload files/directories to ipfs

func NewICPDeployAction added in v1.0.3

func NewICPDeployAction(ac ctx.ActionContext) *ICPDeployAction

func (*ICPDeployAction) Hook added in v1.0.3

func (a *ICPDeployAction) Hook() (*model.ActionResult, error)

func (*ICPDeployAction) Post added in v1.0.3

func (a *ICPDeployAction) Post() error

func (*ICPDeployAction) Pre added in v1.0.3

func (a *ICPDeployAction) Pre() error

type ImageBuildAction added in v1.0.3

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

func NewImageBuildAction added in v1.0.3

func NewImageBuildAction(step model.Step, ctx context.Context, output *output.Output) *ImageBuildAction

func (*ImageBuildAction) ExecuteCommand added in v1.0.3

func (i *ImageBuildAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*ImageBuildAction) Hook added in v1.0.3

func (i *ImageBuildAction) Hook() (*model.ActionResult, error)

func (*ImageBuildAction) Post added in v1.0.3

func (i *ImageBuildAction) Post() error

func (*ImageBuildAction) Pre added in v1.0.3

func (i *ImageBuildAction) Pre() error

type ImagePushAction added in v1.0.3

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

func NewImagePushAction added in v1.0.3

func NewImagePushAction(step model.Step, ctx context.Context, output *output.Output) *ImagePushAction

func (*ImagePushAction) ExecuteCommand added in v1.0.3

func (i *ImagePushAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*ImagePushAction) Hook added in v1.0.3

func (i *ImagePushAction) Hook() (*model.ActionResult, error)

func (*ImagePushAction) Post added in v1.0.3

func (i *ImagePushAction) Post() error

func (*ImagePushAction) Pre added in v1.0.3

func (i *ImagePushAction) Pre() error

type Impact added in v1.0.3

type Impact struct {
	Critical      int `json:"CRITICAL"`
	Low           int `json:"LOW"`
	High          int `json:"HIGH"`
	Medium        int `json:"MEDIUM"`
	Informational int `json:"INFORMATIONAL"`
}

type InkAction

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

func NewInkAction

func NewInkAction(step model.Step, ctx context.Context, output *output.Output) *InkAction

func (*InkAction) ExecuteCommand

func (a *InkAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*InkAction) ExecuteStringCommand

func (a *InkAction) ExecuteStringCommand(command, workdir string) (string, error)

func (*InkAction) Hook

func (a *InkAction) Hook() (*model.ActionResult, error)

func (*InkAction) Post

func (a *InkAction) Post() error

func (*InkAction) Pre

func (a *InkAction) Pre() error

type IpfsAction

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

IpfsAction Upload files/directories to ipfs

func NewIpfsAction

func NewIpfsAction(step model.Step, ctx context.Context, output *output.Output) *IpfsAction

func (*IpfsAction) Hook

func (a *IpfsAction) Hook() (*model.ActionResult, error)

func (*IpfsAction) Post

func (a *IpfsAction) Post() error

func (*IpfsAction) Pre

func (a *IpfsAction) Pre() error

type IpfsGatewayCloudReq

type IpfsGatewayCloudReq struct {
	UploadID       string `json:"uploadID"`
	UploadFileType string `json:"upload_file_type"`
	UploadType     string `json:"upload_type"`
	Cid            string `json:"cid"`
	Filename       string `json:"filename"`
	ContentType    string `json:"content_type"`
	Size           int    `json:"size"`
	Url            string `json:"url"`
	Status         string `json:"status"`
	Pin            string `json:"pin"`
	Dht            string `json:"dht"`
}

type Issue added in v1.0.3

type Issue struct {
	FilePath    string
	FileAddress string
	// 该文件具有的问题
	Details []Detail
}

type K8sDeployAction added in v1.0.3

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

func NewK8sDeployAction added in v1.0.3

func NewK8sDeployAction(step model.Step, ctx context.Context, output *output.Output) *K8sDeployAction

func (*K8sDeployAction) Hook added in v1.0.3

func (k *K8sDeployAction) Hook() (*model.ActionResult, error)

func (*K8sDeployAction) Post added in v1.0.3

func (k *K8sDeployAction) Post() error

func (*K8sDeployAction) Pre added in v1.0.3

func (k *K8sDeployAction) Pre() error

type K8sIngressAction added in v1.0.3

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

func NewK8sIngressAction added in v1.0.3

func NewK8sIngressAction(step model.Step, ctx context.Context, output *output.Output) *K8sIngressAction

func (*K8sIngressAction) Hook added in v1.0.3

func (k *K8sIngressAction) Hook() (*model.ActionResult, error)

func (*K8sIngressAction) Post added in v1.0.3

func (k *K8sIngressAction) Post() error

func (*K8sIngressAction) Pre added in v1.0.3

func (k *K8sIngressAction) Pre() error

type MalwareWorkflowEngine added in v1.0.3

type MalwareWorkflowEngine struct {
	Id             string `json:"id"`
	Code           string `json:"code"`
	Severity       string `json:"severity"`
	Title          string `json:"title"`
	Confidence     string `json:"confidence"`
	Description    string `json:"description"`
	Recommendation string `json:"recommendation"`
}

type MetaProjectRes added in v1.0.3

type MetaProjectRes struct {
	Data    MetaProjectsData `json:"data"`
	Message string           `json:"message"`
}

type MetaProjectsData added in v1.0.3

type MetaProjectsData struct {
	Total      int               `json:"total"`
	TotalPages int               `json:"totalPages"`
	Items      []MetaScanProject `json:"items"`
}

type MetaScanCheckAction added in v1.0.3

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

func NewMetaScanCheckAction added in v1.0.3

func NewMetaScanCheckAction(step model.Step, ctx context.Context, output *output.Output) *MetaScanCheckAction

func (*MetaScanCheckAction) Hook added in v1.0.3

func (*MetaScanCheckAction) Post added in v1.0.3

func (m *MetaScanCheckAction) Post() error

func (*MetaScanCheckAction) Pre added in v1.0.3

func (m *MetaScanCheckAction) Pre() error

type MetaScanProject added in v1.0.3

type MetaScanProject struct {
	Id    string `json:"id"`
	Title string `json:"title"`
}

type MoveProverAction added in v1.0.3

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

MoveProverAction MoveProver 合约检查

func NewMoveProverAction added in v1.0.3

func NewMoveProverAction(step model.Step, ctx context.Context, output *output.Output) *MoveProverAction

func (*MoveProverAction) ExecuteCommand added in v1.0.3

func (a *MoveProverAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*MoveProverAction) Hook added in v1.0.3

func (a *MoveProverAction) Hook() (*model.ActionResult, error)

func (*MoveProverAction) Post added in v1.0.3

func (a *MoveProverAction) Post() error

func (*MoveProverAction) Pre added in v1.0.3

func (a *MoveProverAction) Pre() error

type MythRilAction

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

MythRilAction mythRil 合约检查

func NewMythRilAction

func NewMythRilAction(step model.Step, ctx context.Context, output *output.Output) *MythRilAction

func (*MythRilAction) ExecuteCommand

func (a *MythRilAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*MythRilAction) Hook

func (a *MythRilAction) Hook() (*model.ActionResult, error)

func (*MythRilAction) Post

func (a *MythRilAction) Post() error

func (*MythRilAction) Pre

func (a *MythRilAction) Pre() error

type OpenAiChatMessage added in v1.0.3

type OpenAiChatMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type OpenAiChatRequestBody added in v1.0.3

type OpenAiChatRequestBody struct {
	Model    string              `json:"model"`
	Messages []OpenAiChatMessage `json:"messages"`
}

type OpenAiChatResponseBody added in v1.0.3

type OpenAiChatResponseBody struct {
	Id      string `json:"id"`
	Object  string `json:"object"`
	Created uint   `json:"created"`
	Model   string `json:"model"`
	Usage   struct {
		PromptTokens     uint `json:"prompt_tokens"`
		CompletionTokens uint `json:"completion_tokens"`
		TotalTokens      uint `json:"total_tokens"`
	} `json:"usage"`
	Choices []struct {
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
		} `json:"message"`
		FinishReason string `json:"finish_reason"`
		Index        uint   `json:"index"`
	} `json:"choices"`
}

type OpenAiRequestBody added in v1.0.3

type OpenAiRequestBody struct {
	Model            string   `json:"model"`
	Prompt           string   `json:"prompt"`
	Temperature      uint     `json:"temperature"`
	MaxTokens        uint     `json:"max_tokens"`
	TopP             float32  `json:"top_p"`
	FrequencyPenalty float32  `json:"frequency_penalty"`
	PresencePenalty  float32  `json:"presence_penalty"`
	Stop             []string `json:"stop"`
}

type OpenAiResponseBody added in v1.0.3

type OpenAiResponseBody struct {
	Id      string    `json:"id"`
	Object  string    `json:"object"`
	Created uint      `json:"created"`
	Model   string    `json:"model"`
	Choices []Choices `json:"choices"`
	Usage   Usage     `json:"usage"`
}

type OpenaiAction added in v1.0.3

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

func NewOpenaiAction added in v1.0.3

func NewOpenaiAction(step model.Step, ctx context.Context, output *output.Output) *OpenaiAction

func (*OpenaiAction) Hook added in v1.0.3

func (a *OpenaiAction) Hook() (*model.ActionResult, error)

Hook 执行

func (*OpenaiAction) Post added in v1.0.3

func (a *OpenaiAction) Post() error

Post 执行后清理 (无论执行是否成功,都应该有 Post 的清理)

func (*OpenaiAction) Pre added in v1.0.3

func (a *OpenaiAction) Pre() error

Pre 执行前准备

type PinataIpfsAction

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

PinataIpfsAction Upload files/directories to ipfs

func NewPinataIpfsAction

func NewPinataIpfsAction(step model.Step, ctx context.Context, output *output.Output) *PinataIpfsAction

func (*PinataIpfsAction) Hook

func (a *PinataIpfsAction) Hook() (*model.ActionResult, error)

func (*PinataIpfsAction) Post

func (a *PinataIpfsAction) Post() error

func (*PinataIpfsAction) Pre

func (a *PinataIpfsAction) Pre() error

type PinataIpfsPinReq

type PinataIpfsPinReq struct {
	IpfsHash  string `json:"IpfsHash"`  //This is the IPFS multi-hash provided back for your content
	PinSize   string `json:"PinSize"`   //This is how large (in bytes) the content you just pinned is
	Timestamp string `json:"timestamp"` //This is the timestamp for your content pinning (represented in ISO 8601 format)
}

type Poc added in v1.0.3

type Poc struct {
	FunctionName string        `json:"functionName"`
	Parameters   []interface{} `json:"parameters"`
	Location     string        `json:"location"`
	CallDepth    int           `json:"callDepth"`
}

type Range added in v1.0.3

type Range struct {
	Start Start `json:"start"`
	End   End   `json:"end"`
}

type RemoteAction

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

RemoteAction 执行远程命令

func NewRemoteAction

func NewRemoteAction(step model2.Step, ctx context.Context) *RemoteAction

func (*RemoteAction) Hook

func (a *RemoteAction) Hook() (*model2.ActionResult, error)

func (*RemoteAction) Post

func (a *RemoteAction) Post() error

func (*RemoteAction) Pre

func (a *RemoteAction) Pre() error

type Repo added in v1.0.3

type Repo struct {
	Branch     string `json:"branch"`
	CommitHash string `json:"commit_hash"`
}

type ResultOverview added in v1.0.3

type ResultOverview struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
	Impact  Impact `json:"impact"`
}

type SPAffectedFiles added in v1.0.3

type SPAffectedFiles struct {
	Text       string       `json:"text"`
	Range      Range        `json:"range"`
	Highlights []Highlights `json:"highlights"`
}

type SPDetail added in v1.0.3

type SPDetail struct {
	ID            string
	Code          string
	Severity      string
	Title         string
	Description   string
	Function      string          `json:"function"`
	AffectedFiles SPAffectedFiles `json:"affectedFiles"`
	Poc           []Poc           `json:"poc"`
}

type SPIssue added in v1.0.3

type SPIssue struct {
	FilePath    string
	FileAddress string
	// 该文件具有的问题
	Details []SPDetail
}

type SPJson added in v1.0.3

type SPJson struct {
	Version string
	Success bool
	Message string
	Issues  map[string]SPIssue
}

type SecurityAnalyzerResponse added in v1.0.3

type SecurityAnalyzerResponse struct {
	Success     bool                     `json:"success"`
	Error       string                   `json:"error"`
	Results     []SecurityAnalyzerResult `json:"results"`
	FileMapping map[string]string        `json:"file_mapping"`
}

type SecurityAnalyzerResult added in v1.0.3

type SecurityAnalyzerResult struct {
	Mwe           MalwareWorkflowEngine `json:"mwe"`
	ShowTitle     string                `json:"show_title"`
	AffectedFiles []AffectedFile        `json:"affected_files"`
}

type SecurityProverResponse added in v1.0.3

type SecurityProverResponse struct {
	Results     []SecurityProverResults `json:"securityProverResults"`
	FileMapping map[string]string       `json:"file_mapping"`
	Success     bool                    `json:"success"`
	Error       string                  `json:"error"`
	Message     string                  `json:"message"`
	Version     string                  `json:"version"`
}

type SecurityProverResults added in v1.0.3

type SecurityProverResults struct {
	ID            string          `json:"id"`
	Code          string          `json:"code"`
	Severity      string          `json:"severity"`
	Title         string          `json:"title"`
	Description   string          `json:"description"`
	Function      string          `json:"function"`
	AffectedFiles []AffectedFiles `json:"affectedFiles"`
	Poc           []Poc           `json:"poc"`
}

type ShellAction

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

ShellAction 命令工作

func NewShellAction

func NewShellAction(step model2.Step, ctx context.Context, output *output.Output) *ShellAction

func (*ShellAction) Hook

func (a *ShellAction) Hook() (*model2.ActionResult, error)

func (*ShellAction) Post

func (a *ShellAction) Post() error

func (*ShellAction) Pre

func (a *ShellAction) Pre() error

type SlitherAction

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

SlitherAction slither合约检查

func NewSlitherAction

func NewSlitherAction(step model.Step, ctx context.Context, output *output.Output) *SlitherAction

func (*SlitherAction) ExecuteCommand

func (a *SlitherAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*SlitherAction) Hook

func (a *SlitherAction) Hook() (*model.ActionResult, error)

func (*SlitherAction) Post

func (a *SlitherAction) Post() error

func (*SlitherAction) Pre

func (a *SlitherAction) Pre() error

type SolHintAction

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

SolHintAction SolHint 合约检查

func NewSolHintAction

func NewSolHintAction(step model.Step, ctx context.Context, output *output.Output) *SolHintAction

func (*SolHintAction) ExecuteCommand

func (a *SolHintAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*SolHintAction) Hook

func (a *SolHintAction) Hook() (*model.ActionResult, error)

func (*SolHintAction) Post

func (a *SolHintAction) Post() error

func (*SolHintAction) Pre

func (a *SolHintAction) Pre() error

type SolProfilerAction

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

SolProfilerAction SolProfiler 合约检查

func NewSolProfilerAction

func NewSolProfilerAction(step model.Step, ctx context.Context, output *output.Output) *SolProfilerAction

func (*SolProfilerAction) ExecuteCommand

func (a *SolProfilerAction) ExecuteCommand(commands []string, workdir string) (string, error)

func (*SolProfilerAction) Hook

func (a *SolProfilerAction) Hook() (*model.ActionResult, error)

func (*SolProfilerAction) Post

func (a *SolProfilerAction) Post() error

func (*SolProfilerAction) Pre

func (a *SolProfilerAction) Pre() error

type Start added in v1.0.3

type Start struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

type StartTaskRes added in v1.0.3

type StartTaskRes struct {
	Data    TaskData `json:"data"`
	Message string   `json:"message"`
}

type SummaryData added in v1.0.3

type SummaryData struct {
	ResultOverview ResultOverview `json:"resultOverview"`
}

type SummaryDataRes added in v1.0.3

type SummaryDataRes struct {
	Data    SummaryData `json:"data"`
	Message string      `json:"message"`
}

type TaskData added in v1.0.3

type TaskData struct {
	Id          string       `json:"id"`
	TaskState   string       `json:"taskState"`
	EngineTasks []BaseEntity `json:"engineTasks"`
}

type TaskEnv added in v1.0.3

type TaskEnv struct {
	Node           string `json:"node"`
	Solc           string `json:"solc"`
	PackageManage  string `json:"package_manage"`
	CompileCommand string `json:"compile_command"`
	Variables      string `json:"variables"`
}

type TaskResult added in v1.0.3

type TaskResult struct {
	Title  string `json:"title"`
	Result string `json:"result"`
}

type TaskResultRes added in v1.0.3

type TaskResultRes struct {
	Data    TaskResult `json:"data"`
	Message string     `json:"message"`
}

type TaskScan added in v1.0.3

type TaskScan struct {
	SubPath      string `json:"sub_path"`
	Mode         string `json:"mode"`
	IgnoredPaths string `json:"ignored_paths"`
}

type TaskStatus added in v1.0.3

type TaskStatus struct {
	State string `json:"state"`
}

type TaskStatusRes added in v1.0.3

type TaskStatusRes struct {
	Data    TaskStatus `json:"data"`
	Message string     `json:"message"`
}

type Usage added in v1.0.3

type Usage struct {
	PromptTokens     uint `json:"prompt_tokens"`
	CompletionTokens uint `json:"completion_tokens"`
	TotalTokens      uint `json:"total_tokens"`
}

type WorkdirAction

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

func NewWorkdirAction

func NewWorkdirAction(step model2.Step, ctx context.Context, output *output.Output) *WorkdirAction

func (*WorkdirAction) Hook

func (a *WorkdirAction) Hook() (*model2.ActionResult, error)

Hook 执行

func (*WorkdirAction) Post

func (a *WorkdirAction) Post() error

Post 执行后清理 (无论执行是否成功,都应该有 Post 的清理)

func (*WorkdirAction) Pre

func (a *WorkdirAction) Pre() error

Jump to

Keyboard shortcuts

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