utility

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 24 Imported by: 7

Documentation

Index

Constants

View Source
const ACTIVE = "0"
View Source
const AFTER_DELETE = "AFTER_DELETE"
View Source
const AFTER_INSERT = "AFTER_INSERT"
View Source
const AFTER_STATE = "AFTER_STATE"
View Source
const AFTER_UPDATE = "AFTER_UPDATE"
View Source
const APPROVAL = "5"
View Source
const ARCHIVED = "1"
View Source
const BEFORE_DELETE = "BEFORE_DELETE"
View Source
const BEFORE_INSERT = "BEFORE_INSERT"
View Source
const BEFORE_STATE = "BEFORE_STATE"
View Source
const BEFORE_UPDATE = "BEFORE_UPDATE"
View Source
const CACHE_TIME = 60 * 60 * 24 * 1
View Source
const CANCELLED = "2"
View Source
const DAY_SECOND = 60 * 60 * 24 * 1
View Source
const DELETE = "DELETE"
View Source
const FOR_DELETE = "-2"
View Source
const FOUND = "Found"
View Source
const (
	HASH_COST = 5
)
View Source
const INSERT = "INSERT"
View Source
const IN_PROCESS = "3"
View Source
const NOT_FOUND = "Not found"
View Source
const OF_SYSTEM = "-1"
View Source
const PENDING_APPROVAL = "4"
View Source
const REFUSED = "6"
View Source
const ROWS = 30
View Source
const SELECt = "SELECT"
View Source
const STOP = "Stop"
View Source
const UPDATE = "UPDATE"
View Source
const VALUE_NOT_BOOL = "Value is not bolean"

Variables

This section is empty.

Functions

func Address

func Address(host string, port int) string

func BannerTitle

func BannerTitle(name, version string, size int) string

func BinarySearch

func BinarySearch(arr []string, target string) int

func Contains

func Contains(v interface{}, vals ...interface{}) bool

func DecryptoAES

func DecryptoAES(value string) (string, error)

func Dijkstra

func Dijkstra(graph [][]int, start int) []int

func DivInt

func DivInt(a, b int64) int64

func DivNum

func DivNum(a, b float64) float64

func Encrypt

func Encrypt(value string, cryptoType CryptoType) (string, error)

func ExtractMencion

func ExtractMencion(str string) []string

func FindIndex added in v0.0.2

func FindIndex(arr []string, valor string) int

func GenId

func GenId(id string) string

func GeneratePortNumber

func GeneratePortNumber() int

func GetCodeVerify added in v0.0.2

func GetCodeVerify(length int) string

func GoMod

func GoMod(atrib string) (string, error)

func InInt

func InInt(val string, in []string) bool

func InStr

func InStr(val string, in []string) bool

func IsJsonBuild added in v0.0.2

func IsJsonBuild(str string) bool

func MinDistance

func MinDistance(dist []int, visited []bool) int

func NewId added in v0.0.2

func NewId() string

func NilId added in v0.0.2

func NilId(id string) string

func Now

func Now() string

func OkOrNot added in v0.0.2

func OkOrNot(condition bool, ok interface{}, not interface{}) interface{}

func ParamQuote

func ParamQuote(str string, args ...any) string

func Params

func Params(str string, args ...any) string

func PasswordHash added in v0.0.2

func PasswordHash(password string) (string, error)

func PasswordMatch added in v0.0.2

func PasswordMatch(hashPassword string, password string) bool

func Pointer added in v0.0.2

func Pointer(collection string, id string) string

func QuickSort

func QuickSort(arr []int) []int

func Quote

func Quote(val interface{}) any

func TimeDifference

func TimeDifference(dateInt, dateEnd any) time.Duration

func UUID

func UUID() string

func ValidCode

func ValidCode(val string) bool

func ValidEmail

func ValidEmail(val string) bool

func ValidId

func ValidId(val string) bool

func ValidIn

func ValidIn(val string, min int, in []string) bool

func ValidInt

func ValidInt(val int, notIn []int) bool

func ValidKey

func ValidKey(val string) bool

func ValidName

func ValidName(val string) bool

func ValidNum

func ValidNum(val float64, notIn []float64) bool

func ValidPhone

func ValidPhone(val string) bool

func ValidStr

func ValidStr(val string, min int, notIn []string) bool

func ValidUUID

func ValidUUID(val string) bool

Types

type CryptoType

type CryptoType int
const (
	MD5 CryptoType = iota
	SHA1
	SHA256
	SHA512
	AES
)

func GetCryptoType

func GetCryptoType(value string) CryptoType

Type return a crypto type from a string

func (CryptoType) String

func (c CryptoType) String() string

String return string of crypto type

type Num

type Num float64

Jump to

Keyboard shortcuts

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