package
2.0.0+incompatible
Repository: https://github.com/ovh/tat.git
Documentation: pkg.go.dev

# Functions

ArrayContains return true if element is in array.
DateFromFloat returns a time.Time from a float.
GeneratePassword return clear password (to user only), salt and hashed password salt and hashed password are stored in db.
GenerateSalt generates salt, 32 length, with rand.Reader.
GetCtxUsername return username, getting value in gin.Context.
Ginrus returns a gin.HandlerFunc (middleware) that logs requests using logrus.
HashPassword hashes password, with given salt It uses sha512.Sum.
IsCheckValid return false if hashedVersion of clar is not equals to hash hash contains $sha512$salt$passwordHashed$.
IsTatAdmin return true if user is admin.
IsTatSystem return true if user is a system user.
ItemInBothArrays return true if an element is in both array.
Round rounds float.
SendAskResetEmail send a mail to user, ask him to confirm reset password.
SendVerifyEmail send a mail to new user, ask him to valide his new account.
SplitFloatForTimeUnix returns a.b a and b, b with 9 numbers then, time.Unix(a,b) for initialize date from a float64.
TatTSFromDate returns a timestamp with float.
TatTSFromNow returns a timestamp with float for timeNow().

# Variables

TatCtxIsAdmin is used in Gin Context True if user is admin.
TatCtxIsSystem is used in Gin Context True if user is a system user.
TatHeaderUsername is a Header send by user with his username.
TatHeaderUsernameLower is a Header in lowercase.
TatHeaderUsernameLowerDash is a Header in lowercase, and dash : tat-username.