Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - func Assert(guard bool, text string)
 - func ConvertToBytes(size float64, unit SizeUnit) (int64, error)
 - func EscapeQuotes(s string) string
 - func GenerateRandomToken(length int) (string, error)
 - func GenerateRange(start, end int) []int
 - func GenerateSalt(length int) (string, error)
 - func GetFolderPath(folderName string) string
 - func GetRandomIndex(min, max int) (int, error)
 - func HashPassword(data string, salt string, length int) (string, error)
 - func IsASCII(s string) bool
 - func MsToDay(ms int64) int64
 - func MsToHr(ms int64) int64
 - func MsToHuman(ms int64, maxUnit string) string
 - func MsToMin(ms int64) int64
 - func MsToSec(ms int64) int64
 - func NewRedisClient(redisAddr string) *redis.Client
 - func Retryable(fn func() error, retries int, backoffType string, delay time.Duration) error
 - func ShuffleNumbers(numbers []int) ([]int, error)
 - func Sleep(ms int64)
 - type SizeUnit
 
Constants ¶
      View Source
      
  
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Purple = "\033[35m" SkyBlue = "\033[36m" )
Variables ¶
This section is empty.
Functions ¶
func ConvertToBytes ¶
ConvertToBytes converts a size given in the specified unit to bytes.
func EscapeQuotes ¶
func GenerateRandomToken ¶
GenerateRandomToken creates a random token of the specified length.
func GenerateRange ¶
GenerateRange creates a range of numbers from start to end.
func GenerateSalt ¶
GenerateSalt creates a random salt of the given length.
func GetFolderPath ¶
func GetRandomIndex ¶
GetRandomIndex generates a random index between min and max.
func HashPassword ¶
HashPassword generates a hash for the given data using the provided salt.
func NewRedisClient ¶
func NewRedisClient(redisAddr string) *redis.Client
func ShuffleNumbers ¶
ShuffleNumbers randomly shuffles a slice of numbers.
Types ¶
 Click to show internal directories. 
   Click to hide internal directories.