Skip to content

Releases: Cloudment/utils-go

v0.0.4 - Random Durations and OTP codes

06 Feb 17:19
523398f
Compare
Choose a tag to compare
  • Added a feature to randomly generate random durations utils.GenerateRandomDuration(1, 10, time.Second)
  • Added a feature to generate OTP codes GenerateOTP(6) that are number based.

Added some direction for environment utilities.

v0.0.3 - Trailing slash for prefixes in envs

27 Jan 15:20
6f2f65d
Compare
Choose a tag to compare

In the case of using structs for environment variables in a config, previously you had to define an _ in the tag, now it checks if it should add one or not.

v0.0.2 - Error handling and comments

24 Jan 15:57
bd8e127
Compare
Choose a tag to compare
  • Added a few missing comments
  • Fixed handling with time.ParseDuration with days, as days aren't always exactly 24 hours long, added a note into error message for better user understanding.

error loading environment variables: failed to parse value: time: unknown unit \"d\" in duration \"90d\"

to

error loading environment variables: failed to parse value: use '24h' instead of '1d' for 24 hours: time: unknown unit "d" in duration "1d"

First release

14 Jan 20:53
288916c
Compare
Choose a tag to compare

Initial release for env reading and basic utils.

  • GORM search query
  • Bind request to struct for http
  • Read env file to a struct