Documentation ¶
Index ¶
- Constants
- Variables
- func AppendPlaceholder(condition string) string
- func DecodeOutputKey(express string) (string, bool)
- func EvalResultToString(result interface{}) (string, error)
- func GenAutotestConfigParams(key string) string
- func GenConfigParams(key string) string
- func GenDirsRef(alias string) string
- func GenOldParamsRef(param string) string
- func GenOutputRef(alias, outputName string) string
- func GenParamsRef(param string) string
- func GenRandomRef(key string) string
- func MatchEval(str string, placeholderParams map[string]string, matchType ...string) (string, error)
- func Quote(s string) string
- 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" Base64Decode = "base64-decode" TriggerLabel = "triggers" )
View Source
const ( TaskNotJumpOver SignType = 1 // task 不跳过 TaskJumpOver SignType = 0 // task 跳过 LeftPlaceholder = "${{" RightPlaceholder = "}}" OldLeftPlaceholder = "${" OldRightPlaceholder = "}" )
Variables ¶
View Source
var MockString = []string{"string", "integer", "integer_length", "float", "boolean", "upper", "lower", "mobile", "digital_letters", "letters", "character", "timestamp",
"timestamp_hour", "timestamp_after_hour", "timestamp_day", "timestamp_after_day", "timestamp_ms", "timestamp_ms_hour", "timestamp_ms_after_hour",
"timestamp_ms_day", "timestamp_ms_after_day", "timestamp_ns", "timestamp_ns_hour", "timestamp_ns_after_hour", "timestamp_ns_day",
"timestamp_ns_after_day", "date", "date_day", "datetime", "datetime_hour"}
View Source
var OldRe = regexp.MustCompile(`\${([^{}]+)}`)
View Source
var Re = pexpr.PhRe
匹配 ${{ xxx }}
Functions ¶
func AppendPlaceholder ¶
func DecodeOutputKey ¶ added in v1.3.0
func EvalResultToString ¶
func GenAutotestConfigParams ¶ added in v1.1.0
func GenConfigParams ¶
func GenDirsRef ¶ added in v1.1.0
func GenOldParamsRef ¶ added in v1.1.0
func GenOutputRef ¶ added in v1.1.0
func GenParamsRef ¶ added in v1.1.0
func GenRandomRef ¶ added in v1.1.0
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) (sign ExpressionExecSign)
Click to show internal directories.
Click to hide internal directories.