tasks

package
v1.75.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: BSD-3-Clause Imports: 14 Imported by: 7 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tasks 处理的事务任务

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFileExistedTask

type CheckFileExistedTask struct {
	TaskBase
	FileName string
}

CheckFileExistedTask 检测文件是否存在

func (*CheckFileExistedTask) Execute

func (c *CheckFileExistedTask) Execute() error

Execute 执行

func (*CheckFileExistedTask) GetName

func (c *CheckFileExistedTask) GetName() string

GetName 获取name

type CopyTemplateToOutputTask

type CopyTemplateToOutputTask struct {
	TaskBase
	TemplatePath string
	OutputPath   string
	ProjectName  string
	ClassName    string
}

CopyTemplateToOutputTask ...

func (*CopyTemplateToOutputTask) Execute

func (c *CopyTemplateToOutputTask) Execute() error

Execute 执行

func (*CopyTemplateToOutputTask) GetName

func (c *CopyTemplateToOutputTask) GetName() string

GetName 获取name

type CreateFileFromStrTemplateTask

type CreateFileFromStrTemplateTask struct {
	TaskBase
	SourceStr       string
	OutputFile      string
	BlockStrBegin   string // Block会将SourceStr包含在内部
	BlockStrEnd     string
	ReplaceKeyPairs map[string]string
	// contains filtered or unexported fields
}

CreateFileFromStrTemplateTask 从指定的模板字符串中创建目标文件的任务

func (*CreateFileFromStrTemplateTask) Execute

func (c *CreateFileFromStrTemplateTask) Execute() error

Execute 执行

func (*CreateFileFromStrTemplateTask) GetName

GetName 获取name

type FormatDappSourceTask

type FormatDappSourceTask struct {
	TaskBase
	OutputFolder string
}

FormatDappSourceTask 利用Go工具,对生成出来的Go源码进行格式化

func (*FormatDappSourceTask) Execute

func (f *FormatDappSourceTask) Execute() error

Execute 执行

func (*FormatDappSourceTask) GetName

func (f *FormatDappSourceTask) GetName() string

GetName 获取name

type GenDappCodeTask

type GenDappCodeTask struct {
	TaskBase
	DappName    string
	DappDir     string
	ProtoFile   string
	PackagePath string
	// contains filtered or unexported fields
}

GenDappCodeTask 通过生成好的pb.go和预先设计的模板,生成反射程序源码

func (*GenDappCodeTask) Execute

func (c *GenDappCodeTask) Execute() error

Execute 执行

func (*GenDappCodeTask) GetName

func (c *GenDappCodeTask) GetName() string

GetName 获取name

type ReplaceTargetTask

type ReplaceTargetTask struct {
	TaskBase
	OutputPath  string
	ProjectName string
	ClassName   string
	ActionName  string
	ExecName    string
}

ReplaceTargetTask 替换指定目录下所有文件的标志性文字 可替换的名字列表如下: ${PROJECTNAME} ${CLASSNAME} ${ACTIONNAME} ${EXECNAME}

func (*ReplaceTargetTask) Execute

func (r *ReplaceTargetTask) Execute() error

Execute 执行具体的替换动作 1. 扫描指定的output路径 2. 打开每一个文件,根据替换规则替换内部的所有标签 3. 保存时查看文件名是否要替换,如果要则替换后保存,否则直接保存 4. 一直到所有的文件都替换完毕

func (*ReplaceTargetTask) GetName

func (r *ReplaceTargetTask) GetName() string

GetName 获取name

type Task

type Task interface {
	GetName() string
	Next() Task
	SetNext(t Task)

	Execute() error
}

Task 处理的事务任务

type TaskBase

type TaskBase struct {
	NextTask Task
}

TaskBase task base

func (*TaskBase) Execute

func (t *TaskBase) Execute() error

Execute 执行

func (*TaskBase) Next

func (t *TaskBase) Next() Task

Next 获取next

func (*TaskBase) SetNext

func (t *TaskBase) SetNext(task Task)

SetNext set next

type UpdateInitFileTask

type UpdateInitFileTask struct {
	TaskBase
	Folder string
	// contains filtered or unexported fields
}

UpdateInitFileTask 通过扫描本地目录更新init.go文件

func (*UpdateInitFileTask) Execute

func (up *UpdateInitFileTask) Execute() error

Execute 执行

func (*UpdateInitFileTask) GetName

func (up *UpdateInitFileTask) GetName() string

GetName 获取name

Jump to

Keyboard shortcuts

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