Versions in this module Expand all Collapse all v1 v1.9.1 Jun 12, 2021 Changes in this version + const Black + const Blue + const Cyan + const Email + const FORMFE + const Green + const HBlack + const HBlue + const HCyan + const HGreen + const HMagenta + const HRed + const HWhite + const HYellow + const IP + const Magenta + const MaxURLRuneCount + const MinURLRuneCount + const Red + const URL + const URLIP + const URLPath + const URLPort + const URLSchema + const URLSubdomain + const URLUsername + const White + const Yellow + var EXT = map[string]string + var EmailFor = regexp.MustCompile(Email) + var Msj = StMsj + var SMTPPORT = map[string]string + var SMTPURL = map[string]string + var TypeContent = map[string]string + var URLFor = regexp.MustCompile(URL) + func AsignarPtr(a interface{}) interface + func BytetoStr(str []byte) string + func BytetoStrHex(str []byte) string + func CharRand(Upper bool) string + func CpDir(PathOrig, PathDest string) error + func CpFile(PathOrig, PathDest string) error + func DateEquals(b time.Time, v time.Time) bool + func DateIdent(b time.Time, v time.Time) bool + func DesencripAES(key string, text string) (string, error) + func DirNew(Path string) error + func EncripAES(key string, text string) (string, error) + func FActual() time.Time + func FNulo() time.Time + func FileExist(Path string, inddir bool) bool + func FileExt(Path string, ext string) bool + func FileNew(p string) (*os.File, error) + func FileRename(PathOrigen, PathNuevo string) error + func FilterExcl(strs []string, excl []string) []string + func FilterStr(strs []string, valid func(string) bool) (ret []string) + func Float64ToStr(val float64) string + func GenToken(str string) string + func GeneredHashMd5(key string) string + func GeneredHashSha256(key string) string + func GeneredUUID() string + func GetCPU() int + func GetLines(s string) []string + func GetLocalIPV4() string + func InStr(str string, strs ...string) bool + func Int32ToStr(val int32) string + func Int64ToStr(val int64) string + func IntToStr(val int) string + func IsEmail(str string) bool + func IsEmptyVl(v reflect.Value) bool + func IsLinux() bool + func IsMac() bool + func IsNilArrayStr(strs ...string) bool + func IsNilStr(str string) bool + func IsSO(so string) bool + func IsSpace(str string) bool + func IsURL(str string) bool + func IsWindows() bool + func JSONtoObj(d JSON) ([]map[string]interface{}, error) + func ListDir(src string) ([]fs.DirEntry, error) + func LowerStrs(strs ...string) []string + func MapKeys(data *map[interface{}]interface{}) []interface + func MapStrKeys(data *map[string]interface{}) []string + func MaxCPUtask() int + func MaxCPUtaskLimit(TASKCORE int) int + func Merge(base, override interface{}) interface + func MsjBlue(format string, arg ...interface{}) string + func MsjGreen(format string, arg ...interface{}) string + func MsjPc(c Pc, format string, arg ...interface{}) string + func MsjRed(format string, arg ...interface{}) string + func NewTicker(ft, tp string) (*time.Ticker, error) + func NumProcSet(n int) int + func Open(Path string) (*os.File, error) + func ParseJSON(d JSON, v interface{}) error + func PlecaAdd(src string) string + func PrintGreen(format string, arg ...interface{}) + func PrintMap(format string, data map[string]interface{}) string + func PrintPc(c Pc, format string, arg ...interface{}) + func PrintRed(format string, arg ...interface{}) + func RandInt(min, max int) int + func ReadFileStr(path string) (string, error) + func ReturnIf(a bool, b, c interface{}) interface + func Reverse(s string) string + func RmDir(src string) error + func RmFile(file string) error + func RoundFloat64(valor float64, dec int) float64 + func SliceStrToStr(strs []string, separador string) string + func StrErr(str string) error + func StrRand(cant int, Upper bool) string + func StrToFloat64(val string) (float64, error) + func StrToInt32(val string) (int32, error) + func StrToInt64(val string) (int64, error) + func StringToDate(s string) (time.Time, error) + func StrtoByte(str string) []byte + func StrtoByteHex(str string) []byte + func StructToMap(i interface{}) (valores url.Values) + func SubString(s string, start, end int) string + func Throw(up Exception) + func TimeEqual(b time.Time, v time.Time) bool + func TimetoStr(dia time.Time) string + func ToBoolean(data interface{}) bool + func ToDateStr(t time.Time) string + func ToDateStrSingle(t time.Time) string + func ToFloat(i interface{}) float32 + func ToFloat64(i interface{}) float64 + func ToInt(i interface{}) int + func ToInt16(i interface{}) int16 + func ToInt32(i interface{}) int32 + func ToInt64(i interface{}) int64 + func ToInt8(i interface{}) int8 + func ToMapInterface(i interface{}) (map[string]interface{}, error) + func ToString(i interface{}) string + func ToTime(data interface{}) (tim time.Time, err error) + func Trim(str string) string + func TrimFile(Path string) (string, error) + func UpperStrs(strs ...string) []string + func ValidDuplidArrayStr(strs []string) bool + func Write(Path string, data []byte) error + type Block struct + Catch func(Exception) + Finally func() + Try func() + func (tcf Block) Do() + type Component string + func (p *Component) Add(data ...Component) *Component + func (p *Component) Body(vladd string) *Component + func (p *Component) Byte() []byte + func (p *Component) HTML(styles string) *Component + func (p *Component) Map(key string, data ...Component) *Component + func (p *Component) Print(key string, data interface{}) *Component + func (p *Component) PrintMap(data map[string]interface{}) *Component + func (p *Component) String() string + type ConfigWorker struct + ConfigDir StArchMa + Debug bool + Pathlog string + Workers FormatWorker + type Date struct + func NewDateNow() Date + func (p *Date) Equals(data Date) int + func (p *Date) HrTime() HrTime + func (p *Date) ToString() string + func (p *Date) UnmarshalJSON(input []byte) error + func (p *Date) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Exception interface + type Float64XML float64 + func (f Float64XML) MarshalXMLAttr(name xml.Name) (xml.Attr, error) + type FormatWorker []struct + type HrTime struct + func NewHrTime(hr, min int) (HrTime, error) + func NewHrTimeDate(data Date) (HrTime, error) + func NewHrTimeStr(fr string) (HrTime, error) + func (p *HrTime) EqualDate(date Date) bool + func (p *HrTime) EqualNow() bool + func (p *HrTime) GetHr() (hr, min int) + func (p *HrTime) SetHr(hr, min int) error + func (p *HrTime) SetHrTime(hr, min int) error + func (p *HrTime) Valid() error + type JSON []byte + func NewJSON(v interface{}) (JSON, error) + func ObjtoJSON(Encabezado []string, filas [][]interface{}) (JSON, error) + type Job func(chan bool, chan error) + type MasterWorker struct + Jobs map[string]Job + func NewMasterWorker(Jobs map[string]Job, config string, indload bool) (MasterWorker, error) + func (p *MasterWorker) Debug(key, format string, args ...interface{}) error + func (p *MasterWorker) Err(key string) <-chan error + func (p *MasterWorker) Error(key, format string, args ...interface{}) error + func (p *MasterWorker) Finally(key string) + func (p *MasterWorker) FinallyDet(key, msg string, indreload, inderr bool) error + func (p *MasterWorker) LoadConfig(PathJSON string) error + func (p *MasterWorker) LoadWorkers() (map[string]*Worker, error) + func (p *MasterWorker) Loadmaster() error + func (p *MasterWorker) Printf(err bool, key, format string, args ...interface{}) error + func (p *MasterWorker) ReloadConfig() error + func (p *MasterWorker) ReloadWork(key string) error + func (p *MasterWorker) SendWork(key string) (*Worker, error) + func (p *MasterWorker) SetActivo(key string, act bool) + func (p *MasterWorker) StartDet(key, msg string) + func (p *MasterWorker) StartGen(key string) + func (p *MasterWorker) Tick(key string) <-chan time.Time + func (p *MasterWorker) Valid(key string) <-chan bool + func (p *MasterWorker) ValidWork(key string) bool + type Pc string + type StArch struct + IndDir bool + Path string + func (p *StArch) Create() error + type StArchMa []StArch + func (p *StArchMa) Create() error + type StAuthEmail struct + Email string + Host string + Pass string + Port string + func NewAuth(email, pass, host, port string) StAuthEmail + func (p *StAuthEmail) Validar() bool + type StEmail struct + BodyMsg string + ContentType string + HeadMsg string + func (p *StEmail) Validar() bool + type StEmailAdmin struct + Dest []string + Email StEmail + User StAuthEmail + func (p *StEmailAdmin) AddBody(content, header, body string) + func (p *StEmailAdmin) AddBodyHTML(header, body string) + func (p *StEmailAdmin) AddDest(dest ...string) + func (p *StEmailAdmin) AddUser(email, pass, host, port string) + func (p *StEmailAdmin) ArmarEmail() string + func (p *StEmailAdmin) SendMail() error + func (p *StEmailAdmin) Validar() bool + type StError struct + What string + When time.Time + func (p *StError) Error() string + func (p *StError) MandError(mensaje string) error + type StLog struct + Dir string + Fe time.Time + Name string + Prefix string + func NewStLog(dir, name, prefix string, fe time.Time) (StLog, error) + func (p *StLog) Init() error + func (p *StLog) Printf(format string, args ...interface{}) error + func (p *StLog) ValidF() + type StMsj struct + Store map[string]string + func (p *StMsj) AddMsj(code, msj string) + func (p *StMsj) AddStore(store map[string]string) + func (p *StMsj) GetError(code string) error + func (p *StMsj) GetString(code string) string + type Worker struct + func NewWork(format, tp string, job Job) (Worker, error) + func NewWorkTicker(p *time.Ticker, job Job) Worker + func NewWorkTime(hr, min int, job Job) (Worker, error) + func (p *Worker) Err() <-chan error + func (p *Worker) Finally() + func (p *Worker) GetStart() bool + func (p *Worker) SetActivo(act bool) + func (p *Worker) Start() + func (p *Worker) StartGen() + func (p *Worker) StartTime() + func (p *Worker) Tick() <-chan time.Time + func (p *Worker) Valid() <-chan bool