Documentation ¶
Index ¶
- func Checksum(a string) string
- func ElapsedTimeSince(t time.Time) int64
- func Fingerprint(a string) string
- func GetJSON(url string, target interface{}) error
- func IncT(t int64, m int) int64
- func PostJSON(url string, body interface{}, response interface{}) error
- func PrettyPrintJSON(target interface{})
- func PrintJSON(target interface{}) string
- func PutJSON(url string, target interface{}) error
- func Random(max int) int
- func RandomPlusMinus(max int) int
- func RandomToken(prefix string) (string, error)
- func RequestLogger() gin.HandlerFunc
- func ShortUUID() (string, error)
- func SimpleUUID() (string, error)
- func StringToTime(format, t string) int64
- func Timestamp() int64
- func TimestampNano() int64
- func TimestampToHour(t int64) int
- func TimestampToUTC(t int64) string
- func TimestampToWeekday(t int64) int
- func UUID() (string, error)
- func ValueWithDefault(value, def string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ElapsedTimeSince ¶
ElapsedTimeSince returns the difference between t and now.
func Fingerprint ¶
Fingerprint creates a unique ID (MD5) from a string
func PrettyPrintJSON ¶
func PrettyPrintJSON(target interface{})
PrettyPrintJSON prints a struct to STDOUT nicely
func PrintJSON ¶
func PrintJSON(target interface{}) string
PrintJSON formats a struct into a JSON string
func RandomPlusMinus ¶
RandomPlusMinus returns a random number between -max .. max
func RandomToken ¶
RandomToken generates a random token similar to a to a RFC 4122 UID
func RequestLogger ¶
func RequestLogger() gin.HandlerFunc
RequestLogger is used to print the GIN raw request message body
func SimpleUUID ¶
SimpleUUID generates a random UUID according to RFC 4122, without any dashes
func StringToTime ¶
StringToTime converts a string with a date/time into a timestamp
func TimestampNano ¶
func TimestampNano() int64
TimestampNano returns the curent time in miliseconds UTC
func TimestampToHour ¶
TimestampToHour retuns the hour of the day for the timestamp
func TimestampToUTC ¶
TimestampToUTC converts a timestamp to UTC timestamp
func TimestampToWeekday ¶
TimestampToWeekday retuns the day of the week for the timestamp
func ValueWithDefault ¶
ValueWithDefault returns the value of a default if empty
Types ¶
This section is empty.