Documentation
¶
Index ¶
- Constants
- func Address(host string, port int) string
- func AppWait()
- func BannerTitle(name string, size int) string
- func BinarySearch(arr []string, target string) int
- func Contains(v interface{}, vals ...any) bool
- func DecryptoAES(value string) (string, error)
- func Dijkstra(graph [][]int, start int) []int
- func DivInt(a, b int64) int64
- func DivNum(a, b float64) float64
- func Encrypt(value string, cryptoType CryptoType) (string, error)
- func ExtractMencion(str string) []string
- func FromBase64(data string) (string, error)
- func FromBase64Raw(data string) string
- func GenId(id string) string
- func GenKey(id string) string
- func GeneratePortNumber() int
- func GetOTP(length int) string
- func GetPidByPort(port int) int
- func GetRandom(charset string, length int) string
- func GetRandomString(length int) string
- func GoMod(atrib string) (string, error)
- func Hash(password string) (string, error)
- func InInt(val string, in []string) bool
- func InStr(val string, in []string) bool
- func Match(hashPassword, password string) bool
- func Md5(password string) string
- func MinDistance(dist []int, visited []bool) int
- func More(tag string, expiration time.Duration) int64
- func Now() string
- func NowTime() time.Time
- func ParamQuote(str string, args ...any) string
- func Params(str string, args ...any) string
- func PayloadDecoded(token string) (et.Json, error)
- func PayloadEncoded(data et.Json) string
- func QuickSort(arr []int) []int
- func Quote(val interface{}) any
- func SerializeStruct(s interface{}) ([]byte, error)
- func SetQuotedChar(char string)
- func Sha256(password string) string
- func TimeDifference(dateInt, dateEnd any) time.Duration
- func ToBase64(data string) string
- func ToBase64Raw(data string) string
- func UUID() string
- func UUIndex(tag string) int64
- func Unquote(val interface{}) any
- func ValidCode(val string) 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 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
- func ValidWord(word string) bool
- func Validate(expr, val string) bool
- type CryptoType
- type List
- type Num
Constants ¶
const AFTER_DELETE = "AFTER_DELETE"
const AFTER_INSERT = "AFTER_INSERT"
const AFTER_STATE = "AFTER_STATE"
const AFTER_UPDATE = "AFTER_UPDATE"
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 DAY_SECOND = 60 * 60 * 24 * 1
const DELETE = "DELETE"
const FOUND = "Found"
const (
HASH_COST = 5
)
const INSERT = "INSERT"
const NOT_FOUND = "Not found"
const QUEUE_STACK = "stack"
const ROWS = 30
const SELECt = "SELECT"
const UPDATE = "UPDATE"
const VALUE_NOT_BOOL = "Value is not bolean"
Variables ¶
This section is empty.
Functions ¶
func Address ¶
* * Address return a string with the host and port * @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 ¶
* * BinarySearch * @param arr []string, target string * @return int *
func Contains ¶
* * Contains return true if the value is in the list * @param v interface{} * @param vals ...any * @return bool *
func DecryptoAES ¶
* * DecryptoAES return a string with the value decrypted in aes * @param value string * @return string, error *
func DivInt ¶
* * DivInt return the division of two numbers * @param a int64, b int64 * @return int64 *
func DivNum ¶
* * DivNum return the division of two numbers * @param a float64, b float64 * @return float64 *
func Encrypt ¶
func Encrypt(value string, cryptoType CryptoType) (string, error)
* * Encrypt return a string with the value encrypted in the crypto type * @param value string, cryptoType CryptoType * @return string, error *
func ExtractMencion ¶
* * ExtractMencion return the mentions in a string * @param str string * @return []string *
func FromBase64 ¶
* * FromBase64 * @param data string * @return string *
func FromBase64Raw ¶ added in v0.1.18
* * FromBase64Raw * @param data string * @return string *
func GeneratePortNumber ¶
func GeneratePortNumber() int
* * GeneratePortNumber return a random port number * @return int *
func GetPidByPort ¶
* * GetPidByPort return the pid of a process by port * @param port int * @return int *
func GetRandom ¶ added in v0.1.1
* * GetRandom return a random string * @param charset string, length int * @return string *
func GetRandomString ¶ added in v0.1.1
* * GetRandomString return a random string * @param length int * @return string *
func GoMod ¶
* * GoMod return the value of a go.mod attribute * @param atrib string * @return string * @return error *
func InInt ¶
* * InInt return true if the value is in the list * @param val string * @param in []string * @return bool *
func InStr ¶
* * InStr return true if the value is in the list * @param val string * @param in []string * @return bool *
func MinDistance ¶
* * MinDistance * @param dist []int, visited []bool * @return int *
func ParamQuote ¶
* * ParamQuote return a string with the values replaced * @param str string * @param args ...any * @return string *
func Params ¶
* * Params return a string with the values replaced * @param str string * @param args ...any * @return string *
func PayloadDecoded ¶
* * PayloadDecoded * @param token string * @return et.Json *
func PayloadEncoded ¶
* * PayloadEncoded * @param data et.Json * @return string *
func SerializeStruct ¶
* * SerializeStruct * @param s interface{} * @return []byte * @return error *
func TimeDifference ¶
* * TimeDifference return the difference between two dates * @param dateInt any * @param dateEnd any * @return time.Duration *
func ToBase64Raw ¶ added in v0.1.18
* * ToBase64Raw * @param data string * @return string *
func Unquote ¶
func Unquote(val interface{}) any
* * Unquote * @param val interface{} * @return any *
func ValidEmail ¶
* * ValidEmail * @param val string * @return bool *
func ValidPhone ¶
* * ValidPhone * @param val string * @return bool *
Types ¶
type CryptoType ¶
type CryptoType int
const ( MD5 CryptoType = iota SHA1 SHA256 SHA512 AES )
func GetCryptoType ¶
func GetCryptoType(value string) CryptoType
* * GetCryptoType return a crypto type from a string * @param value string * @return CryptoType *
func (CryptoType) String ¶
func (c CryptoType) String() string
* * String return string of crypto type * @return string *