utils

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 9 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvOrDefault

func GetEnvOrDefault(names ...string) string

GetEnvOrDefault returns the first non-empty environment variable

func Interpolate

func Interpolate(arg string, vars interface{}) string

Interpolate templatises the string using the vars as the context

func InterpolateStrings

func InterpolateStrings(arg []string, vars interface{}) []string

InterpolateStrings templatises each string in the slice using the vars as the context

func RandomKey

func RandomKey(length int) string

func RandomString

func RandomString(length int) string

RandomString returns a random string consisting of the characters in randomChars, with the length customized by the parameter

func ShortTimestamp

func ShortTimestamp() string

ShortTimestamp returns a shortened timestamp using week of year + day of week to represent a day of the e.g. 1st of Jan on a Tuesday is 13

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL