expression

package
v1.0.0-RC Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Dirs    = "dirs"
	Outputs = "outputs"
	Random  = "random"
	Params  = "params"
	Globals = "globals"
	Configs = "configs"
)
View Source
const (
	TaskNotJumpOver  SignType = 1 // task 不跳过
	TaskJumpOver     SignType = 0 // task 跳过
	LeftPlaceholder           = "${{"
	RightPlaceholder          = "}}"

	OldLeftPlaceholder  = "${"
	OldRightPlaceholder = "}"
)

Variables

View Source
var OldRe = regexp.MustCompile(`\${([^{}]+)}`)

匹配 ${{ xxx }}

Functions

func AppendPlaceholder

func AppendPlaceholder(condition string) string

func EvalResultToString

func EvalResultToString(result interface{}) (string, error)

func GenConfigParams

func GenConfigParams(key string) string

GenConfigParams 生成全局参数的表达式

func MatchEval

func MatchEval(str string, placeholderParams map[string]string, matchType ...string) (string, error)

str 整段包含 ${{}} 的字符串 placeholderParams eval 方法的参数 matchType 匹配那些类型 该方法是将 str 进行正则获取全部匹配的表达式,然后根据匹配的表达式执行 eval 方法,最后将表达式替换成执行的值

func ReplacePlaceholder

func ReplacePlaceholder(condition string) string

func ReplaceRandomParams

func ReplaceRandomParams(ori string) string

Types

type ExpressionExecSign

type ExpressionExecSign struct {
	Sign      SignType
	Msg       string
	Err       error
	Condition string
}

func Reconcile

func Reconcile(condition string) ExpressionExecSign

type SignType

type SignType int

Jump to

Keyboard shortcuts

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