Documentation
¶
Index ¶
- func CheckPassword(hash, password string) bool
- func Clamp(value, min, max int) int
- func Contains(haystack, needle string) bool
- func Env(key, fallback string) string
- func Excerpt(s string, words int) string
- func FormatBytes(bytes int64) string
- func FormatDate(t time.Time) string
- func HashPassword(password string) (string, error)
- func MapKeys(m map[string]interface{}) []string
- func Mask(s string, showFirst, showLast int) string
- func RandomString(n int) string
- func Slugify(s string) string
- func StripHTML(s string) string
- func StructToMap(v interface{}) (map[string]interface{}, error)
- func TimeAgo(t time.Time) string
- func Title(s string) string
- func Truncate(s string, max int) string
- type PaginateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword compares a hashed password with a plain-text candidate.
func FormatBytes ¶
FormatBytes converts bytes to human-readable: 1536 → "1.50 KB".
func FormatDate ¶
FormatDate formats time as "Jan 2, 2006 3:04 PM".
func HashPassword ¶
HashPassword hashes a plain-text password using bcrypt.
func RandomString ¶
RandomString generates a cryptographically random hex string of n bytes.
func StructToMap ¶
StructToMap converts a struct to map[string]interface{} via JSON.
Types ¶
Click to show internal directories.
Click to hide internal directories.