Documentation ¶
Index ¶
- func ApplyNamedFormat(format string, data map[string]string) string
- func CalculateProbabilityLimit(slice interface{}) (limit float64)
- func ParseStringEnvVar(name string, required bool, exampleValue string) string
- func RandomElement(slice interface{}) interface{}
- func RandomWeighted(slice interface{}, limit float64) (match interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyNamedFormat ¶
ApplyNamedFormat apply format using a map data
func CalculateProbabilityLimit ¶
func CalculateProbabilityLimit(slice interface{}) (limit float64)
CalculateProbabilityLimit calculates probability limit given a slice, panics when not a slice
func ParseStringEnvVar ¶
ParseStringEnvVar parse an env var value as string
func RandomElement ¶
func RandomElement(slice interface{}) interface{}
RandomElement gets a random element from a slice, panics when not a slice
func RandomWeighted ¶
func RandomWeighted(slice interface{}, limit float64) (match interface{})
RandomWeighted get a randomly weighted value by using each element match probablity, panics when not a slice
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.