Versions in this module Expand all Collapse all v0 v0.1.7 Sep 17, 2024 v0.1.6 Sep 11, 2024 v0.1.5 Sep 11, 2024 v0.1.4 Sep 11, 2024 Changes in this version + func AllCPUs() int + func BeginOfThisMonth(tz *time.Location) time.Time + func BeginOfThisWeek(tz *time.Location) time.Time + func BeginOfThisYear(tz *time.Location) time.Time + func BeginOfToday(tz *time.Location) time.Time + func CeilDate(date time.Time) time.Time + func CheckEmailMX(email string) bool + func CloneStringMap(m map[string]string, keysToLower bool) map[string]string + func CompareArgon2Id(hashed, plain, pepper string) bool + func CompareBcrypt(hashed, plain, pepper string) bool + func ComparePassword(hashed, plain, pepper string) bool + func CronPadToSecondly(expr string) string + func ExtractBasicAuth(r *http.Request) (username, password string, err error) + func ExtractBearerAuth(r *http.Request) (key string, err error) + func FadeColors(color1, color2 color.RGBA, ratio float64) color.RGBA + func FindString(needle string, haystack []string, defaultVal string) string + func HalfCPUs() int + func HasConstraints(db *gorm.DB) bool + func HashArgon2Id(plain, pepper string) (string, error) + func HashBcrypt(plain, pepper string) (string, error) + func HashPassword(plain, pepper string) (string, error) + func HexToRGBA(s string) (c color.RGBA) + func IsCleanDB(db *gorm.DB) bool + func IsNoCache(r *http.Request, cacheTtl time.Duration) bool + func Json(data interface{}) template.JS + func LocalTZOffset() time.Duration + func MustParseTime(layout, value string) time.Time + func ParseJsonDropKeys[T any](r io.Reader, dropKeys ...string) (T, error) + func ParseUserAgent(ua string) (string, string, error) + func ParseWeekday(s string) time.Weekday + func QuoteDbIdentifier(db *gorm.DB, identifier string) string + func QuoteSql(db *gorm.DB, queryTemplate string, identifiers ...string) string + func RGBAToHex(c color.RGBA) string + func RaiseForStatus(res *http.Response, err error) (*http.Response, error) + func SplitMulti(s string, delimiters ...string) []string + func SplitRangeByDays(from time.Time, to time.Time) [][]time.Time + func SubSlice[T any](slice []T, from, to uint) []T + func ToRunes(s string) (r []string) + func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool + func WhereNullable(query *gorm.DB, col string, val any) *gorm.DB + func WithPaging(query *gorm.DB, limit, skip int) *gorm.DB + func WithRecovery(fn func(...interface{}), args ...interface{}) (err error) + func WithRecovery1[T any](fn func(T), a1 T) (err error) + type PageParams struct + Page int + PageSize int + func ParsePageParams(r *http.Request) *PageParams + func ParsePageParamsWithDefault(r *http.Request, page, size int) *PageParams + func (p *PageParams) Limit() int + func (p *PageParams) Offset() int + type TemplateMap map[string]*template.Template + func LoadTemplates(templateFs fs.FS, funcs template.FuncMap) (TemplateMap, error)