Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoPasswordsMatch ¶
DoPasswordsMatch Check if two passwords match using Bcrypt's CompareHashAndPassword which return nil on success and an error on failure.
func DropPrivileges ¶
func DropPrivileges()
func HashPassword ¶
adapted from https://www.gregorygaines.com/blog/how-to-properly-hash-and-salt-passwords-in-golang-bcrypt/ hashPassword Hash password using bcrypt and
func RandomString ¶
RandomString generates a string with the given length using crypt/rand
Types ¶
type CustomError ¶
type CustomError struct {
Message string
}
func (*CustomError) Error ¶
func (e *CustomError) Error() string
type MetaContent ¶
type MetaContent struct { Username string IsLoggedIn bool IsAdmin bool Timestamp string ErrorTitle string ErrorText string }
func GenMetaContent ¶
func GenMetaContent(c *gin.Context) MetaContent
MetaContent collects all the values needed to render the templates that aren't specific to the view and combines them into a structure expected by the template
Click to show internal directories.
Click to hide internal directories.