Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateValue ¶ added in v0.9.10
GenerateValue passes through the input value to all the supported value generators to get the final value. For example, $(random:5) --> xafce $(timenow:RFC3339) --> 2019-05-24T11:10:13+08:00
Types ¶
type Generator ¶
type Generator interface { // Value generates a string value according to params. How params is interpreted is determined by the generator implementation. Value(interface{}) string // Parse parses input string that represents a specific type value. For example, a given length random // string. If the input is not a valid given type ref value, the origin input value is returned. Parse(v string) string }
Generator is used to generate specific type of string value, for example, fixed length random string, timestamp.
type NowTimeStringParam ¶
type NowTimeStringParam struct {
Format string `json:"format"`
}
type RandomValueParam ¶
type RandomValueParam struct {
Length int `json:"length"`
}
Click to show internal directories.
Click to hide internal directories.