Documentation ¶
Index ¶
- Constants
- Variables
- func AppendPlaceholder(condition string) string
- func EvalResultToString(result interface{}) (string, error)
- func GenConfigParams(key string) string
- func MatchEval(str string, placeholderParams map[string]string, matchType ...string) (string, error)
- func ReplacePlaceholder(condition string) string
- func ReplaceRandomParams(ori string) string
- type ExpressionExecSign
- type SignType
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(`\${([^{}]+)}`)
View Source
var Re = pexpr.PhRe
匹配 ${{ xxx }}
Functions ¶
func AppendPlaceholder ¶
func EvalResultToString ¶
func MatchEval ¶
func MatchEval(str string, placeholderParams map[string]string, matchType ...string) (string, error)
str 整段包含 ${{}} 的字符串 placeholderParams eval 方法的参数 matchType 匹配那些类型 该方法是将 str 进行正则获取全部匹配的表达式,然后根据匹配的表达式执行 eval 方法,最后将表达式替换成执行的值
func ReplacePlaceholder ¶
func ReplaceRandomParams ¶
Types ¶
type ExpressionExecSign ¶
func Reconcile ¶
func Reconcile(condition string) ExpressionExecSign
Click to show internal directories.
Click to hide internal directories.