utilities

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 23 Imported by: 0

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 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 added in v0.0.34

func Address(host string, port int) string

func ApendAny

func ApendAny(space string, strs ...any) string

func Append

func Append(str1, str2, sp string) string

func AppendAny

func AppendAny(val1, val2 any, sp string) string

func BannerTitle added in v0.0.34

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

func BinarySearch added in v0.0.35

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

func Contains

func Contains(c []string, v string) bool

func ContainsInt

func ContainsInt(c []int, v int) bool

func DecryptMessage

func DecryptMessage(message string) (string, error)

func Dijkstra added in v0.0.35

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

func Empty

func Empty(str1, str2 string) string

func EncryptMessage

func EncryptMessage(message string) (string, error)

func ExistPath added in v0.0.34

func ExistPath(name string) bool

func ExtencionFile added in v0.0.34

func ExtencionFile(filename string) string

func ExtractMencion

func ExtractMencion(str string) []string

func FindIndex

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

func Format

func Format(format string, args ...any) string

func FormatLowCase

func FormatLowCase(format string, args ...any) string

func FormatUppCase

func FormatUppCase(format string, args ...any) string

func GenId

func GenId(id string) string

func GeneratePortNumber

func GeneratePortNumber() int

func GetCodeVerify

func GetCodeVerify(length int) string

func GetSplitIndex

func GetSplitIndex(str, sep string, idx int) string

func InInt

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

func InStr

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

func IsJsonBuild

func IsJsonBuild(str string) bool

func Lowcase

func Lowcase(s string) string

func MakeFile added in v0.0.34

func MakeFile(folder, name, model string, args ...any) (string, error)

func MakeFolder added in v0.0.34

func MakeFolder(names ...string) (string, error)

func MinDistance added in v0.0.35

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

func ModuleName added in v0.0.37

func ModuleName() (string, error)

func Name

func Name(str string) string

func NewId

func NewId() string

func NotSpace

func NotSpace(str string) string

func Now

func Now() string

func OkOrNot

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

func ParamQuote added in v0.0.34

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

func Params

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

func PasswordHash

func PasswordHash(password string) (string, error)

func PasswordMatch

func PasswordMatch(hashPassword string, password string) bool

func Ping

func Ping()

func Pointer

func Pointer(collection string, id string) string

func Pong

func Pong()

func QuickSort added in v0.0.35

func QuickSort(arr []int) []int

func Quote added in v0.0.34

func Quote(val interface{}) any

func RemoveAcents

func RemoveAcents(str string) string

func RemoveFile added in v0.0.34

func RemoveFile(path string) (bool, error)

func Replace

func Replace(str string, old string, new string) string

func ReplaceAll

func ReplaceAll(str string, olds []string, new string) string

func Split

func Split(str, sep string) []string

func StrToBool

func StrToBool(val string) (bool, error)

func StrToTime added in v0.0.44

func StrToTime(val string) (time.Time, error)

func TimeDifference

func TimeDifference(dateInt, dateEnd any) time.Duration

func Titlecase

func Titlecase(str string) string

func Trim

func Trim(str string) string

func Uppcase

func Uppcase(s string) string

func ValidCode

func ValidCode(val string) bool

func ValidEmail

func ValidEmail(val string) bool

func ValidId

func ValidId(val string) bool

func ValidIn added in v0.0.34

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

func ValidInt

func ValidInt(val int, notIn []int) 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 Any

type Any struct {
	// contains filtered or unexported fields
}

func NewAny

func NewAny(val any) *Any

func (*Any) Bool

func (an *Any) Bool() bool

func (*Any) Int

func (an *Any) Int() int

func (*Any) Num

func (an *Any) Num() float64

func (*Any) Set

func (an *Any) Set(val any) any

func (*Any) String

func (an *Any) String() string

func (*Any) Val

func (an *Any) Val() any

Jump to

Keyboard shortcuts

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