util

package
v0.0.0-...-683df67 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LayoutDefault  = "2006-01-02 15:04:05"
	LayoutDateOnly = "2006-01-02"
	Loc, _         = time.LoadLocation("Asia/Jakarta")
)
View Source
var MDNPrefix08 = 2
View Source
var MDNPrefix62 = 1

Functions

func AESDecryption

func AESDecryption(cipherText string, key string) (string, error)

func AESEncryption

func AESEncryption(text string, key string) (string, error)

func ConvertToDateTime

func ConvertToDateTime(dateTime string) (time.Time, error)

func DateRangeValidation

func DateRangeValidation(dateStart, dateEnd string) (validDate, validRange bool)

func DateValidationYYYY_MM_DD

func DateValidationYYYY_MM_DD(date string) (validDate bool)

func GenerateRandomNumber

func GenerateRandomNumber(len int, to int, data *string)

func GenerateSlug

func GenerateSlug(text string) string

func IsSlug

func IsSlug(text string) bool

IsSlug returns True if provided text does not contain white characters, punctuation, all letters are lower case and only from ASCII range. It could contain `-` and `_` but not at the beginning or end of the text. It should be in range of the MaxLength var if specified. All output from slug.Make(text) should pass this test.

func ReadCsvFile

func ReadCsvFile(file multipart.File) ([]map[string]string, error)

func ReformatMDN

func ReformatMDN(mdn string) string

func ReformatMDNWithPrefiX

func ReformatMDNWithPrefiX(mdn string, prefixType int) string

func ToAscii

func ToAscii(input string) (asci string, asciInt int, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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