utils

package module
v0.0.0-...-2dea52a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

README

go-utils

Go Utils for my project

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrContains

func ArrContains(s []string, e string) bool

func CreateToken

func CreateToken(userId uint64) (string, error)

func Erc20verify

func Erc20verify(address string, resp func(...string)) bool

func FmtDuration

func FmtDuration(d time.Duration) string

func GenerateNewPassword

func GenerateNewPassword(length int) string

func GenerateSecureToken

func GenerateSecureToken(length int) string

func GenerateSocialsToken

func GenerateSocialsToken(length int) string

func GetENV

func GetENV(key string) string

func GetHomeDir

func GetHomeDir() string

func HashPass

func HashPass(password string) string

func InTimeSpan

func InTimeSpan(start, end, check time.Time) bool

func InlineIF

func InlineIF(condition bool, a interface{}, b interface{}) interface{}

func InlineIFT

func InlineIFT[T any](condition bool, a T, b T) T

func IsLower

func IsLower(s string) bool

func IsUpper

func IsUpper(s string) bool

func RandInt

func RandInt(min int, max int) int

func ReadAvatar

func ReadAvatar(filename string) ([]byte, error)

func ReadFile

func ReadFile(fileName string) ([]string, error)

func ReportError

func ReportError(err string, statusCode int)

func ReportMessage

func ReportMessage(message ...string)

func ScheduleFunc

func ScheduleFunc(f func(), interval time.Duration) *time.Ticker

func SendMessage

func SendMessage(token string, title string, body string, data map[string]string)

func ToFixed

func ToFixed(num float64, precision int) float64

func TrimQuotes

func TrimQuotes(s string) string

func WrapErrorLog

func WrapErrorLog(message string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL