Documentation ¶
Index ¶
- Constants
- func Address(host string, port int) string
- func BannerTitle(name string, size int) string
- func BinarySearch(arr []string, target string) int
- func Contains(c []string, v string) bool
- func ContainsInt(c []int, v int) bool
- func DecryptMessage(message string) (string, error)
- func Dijkstra(graph [][]int, start int) []int
- func DivInt(a, b int64) int64
- func DivNum(a, b float64) float64
- func EncryptMessage(message string) (string, error)
- func ExtractMencion(str string) []string
- func FindIndex(arr []string, valor string) int
- func FromBase64(data string) string
- func GenId(id string) string
- func GenKey(id string) string
- func GeneratePortNumber() int
- func GetOTP(length int) string
- func GetPassword(length int) string
- func GoMod(atrib string) (string, error)
- func HashSha256(message string) string
- func InInt(val string, in []string) bool
- func InStr(val string, in []string) bool
- func IsJsonBuild(str string) bool
- func MinDistance(dist []int, visited []bool) int
- func More(tag string, expiration time.Duration) int64
- func NanoId(n int) string
- func NewError(message string) error
- func NewErrorf(format string, args ...any) error
- func NewId() string
- func Now() string
- func NowTime() time.Time
- func OkOrNot(condition bool, ok interface{}, not interface{}) interface{}
- func ParamQuote(str string, args ...any) string
- func Params(str string, args ...any) string
- func PasswordHash(password string) (string, error)
- func PasswordMatch(hashPassword string, password string) bool
- func PasswordSha256(password string) string
- func Pointer(collection string, id string) string
- func PrefixId(prefix string) string
- func PrintFunctionName() string
- func QuickSort(arr []int) []int
- func Quote(val interface{}) any
- func ShortUUID() string
- func SnowflakeID() string
- func TimeDifference(dateInt, dateEnd any) time.Duration
- func ToBase64(data string) string
- func Traces(kind, color string, err error) ([]string, error)
- func ULID() string
- func UUID() string
- func UUIndex(tag string) int64
- func ValidCode(val string, length int) bool
- func ValidEmail(val string) bool
- func ValidId(val string) bool
- func ValidIn(val string, min int, in []string) bool
- func ValidInt(val int, notIn []int) bool
- func ValidKey(val string) bool
- func ValidName(val string) bool
- func ValidNil(val string) bool
- func ValidNum(val float64, notIn []float64) bool
- func ValidPhone(val string) bool
- func ValidStr(val string, min int, notIn []string) bool
- func ValidUUID(val string) bool
- type Num
Constants ¶
const ACTIVE = "0"
const AFTER_DELETE = "AFTER_DELETE"
const AFTER_INSERT = "AFTER_INSERT"
const AFTER_STATE = "AFTER_STATE"
const AFTER_UPDATE = "AFTER_UPDATE"
const APPROVAL = "5"
const ARCHIVED = "1"
const BEFORE_DELETE = "BEFORE_DELETE"
const BEFORE_INSERT = "BEFORE_INSERT"
const BEFORE_STATE = "BEFORE_STATE"
const BEFORE_UPDATE = "BEFORE_UPDATE"
const CACHE_TIME = 60 * 60 * 24 * 1
const CANCELLED = "2"
const DAY_SECOND = 60 * 60 * 24 * 1
const DELETE = "DELETE"
const FOR_DELETE = "-2"
const FOUND = "Found"
const (
HASH_COST = 5
)
const INSERT = "INSERT"
const IN_PROCESS = "3"
const NOT_FOUND = "Not found"
const OF_SYSTEM = "-1"
const PENDING_APPROVAL = "4"
const QUEUE_STACK = "stack"
const REFUSED = "6"
const ROWS = 30
const SELECt = "SELECT"
const STOP = "Stop"
const UPDATE = "UPDATE"
const VALUE_NOT_BOOL = "Value is not bolean"
Variables ¶
This section is empty.
Functions ¶
func Address ¶
* * Address return the value in a string format * @param host string * @param port int * @return string *
func BannerTitle ¶
* * BannerTitle return the value in a string format * @param name string * @param size int * @return string *
func BinarySearch ¶
func Contains ¶
* * Contains return true if the value is in the slice * @param pointer string * @return string *
func ContainsInt ¶
* * ContainsInt return true if the value is in the slice * @param pointer string * @return string *
func DecryptMessage ¶
func EncryptMessage ¶
func ExtractMencion ¶
* * ExtractMencion return the mentions in a string * @param str string * @return []string *
func FindIndex ¶
* * FindIndex return the index of a value in a slice * @param arr []string * @param valor string * @return int *
func FromBase64 ¶
* * FromBase64 * @param data string * @return string *
func GeneratePortNumber ¶
func GeneratePortNumber() int
* * GeneratePortNumber return a random number * @return int *
func GetPassword ¶ added in v1.1.42
* * GetOTP return a random number * @param length int * @return string *
func GoMod ¶
* * GoMod return the value in a string format * @param atrib string * @return string * @return error *
func HashSha256 ¶
func InInt ¶
* * InInt return true if the value is in the slice * @param pointer string * @return string *
func InStr ¶
* * InStr return true if the value is in the slice * @param pointer string * @return string *
func IsJsonBuild ¶
* * IsJsonBuild return true if the string is a json * @param str string * @return bool *
func MinDistance ¶
func OkOrNot ¶
func OkOrNot(condition bool, ok interface{}, not interface{}) interface{}
* * OkOrNot return the value of the condition * @param condition bool * @param ok interface{} * @param not interface{} * @return interface{} *
func ParamQuote ¶
* * ParamQuote return the value in a string format * @param str string * @param args ...any * @return string *
func Params ¶
* * Params return the value in a string format * @param str string * @param args ...any * @return string *
func PasswordHash ¶
func PasswordMatch ¶
func PasswordSha256 ¶ added in v1.1.7
func Pointer ¶
* * Pointer return a string with the format collection/id * @param collection string * @param id string * @return string *
func PrefixId ¶ added in v1.1.50
* * PrefixId return a new UUID with prefix * @param prefix string * @return string *
func PrintFunctionName ¶ added in v1.1.39
func PrintFunctionName() string
func Quote ¶
func Quote(val interface{}) any
* * Quote return the value in a string format * @param val interface{} * @return any *
func ShortUUID ¶ added in v1.1.50
func ShortUUID() string
* * ShortUUID return a new ShortUUID * @return string *
func SnowflakeID ¶ added in v1.1.50
func SnowflakeID() string
* * SnowflakeID return a new SnowflakeID * @return string *
func TimeDifference ¶
* * TimeDifference return the difference between two dates * @param dateInt any * @param dateEnd any * @return time.Duration *