Documentation
¶
Index ¶
- func DownloadFile(filepath string, url string) error
- func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
- func NestedMapLookup(m map[string]interface{}, ks ...string) (rval interface{}, err error)
- func OpenInBrowser(url string) error
- func RandomString(length int) (string, error)
- func StringInArray(str string, list []string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
func IfThenElse ¶
func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
IfThenElse evaluates a condition, if true returns the first parameter otherwise the second
func NestedMapLookup ¶
NestedMapLookup ... m: a map from strings to other maps or values, of arbitrary depth ks: successive keys to reach an internal or leaf node (variadic) If an internal node is reached, will return the internal map
Returns: (Exactly one of these will be nil) rval: the target node (if found) err: an error created by fmt.Errorf
func OpenInBrowser ¶ added in v0.3.0
OpenInBrowser opens the url in a web browser based on OS
func RandomString ¶ added in v0.3.0
RandomString generates a random string of a given length
func StringInArray ¶
StringInArray indicates whether a string value is contained in an array or slice
Types ¶
This section is empty.