Documentation ¶
Index ¶
- type CheckStr
- type Conv
- type ConvProto
- type ConvTime
- type CryptoAES
- type CryptoMD5
- type CryptoSHA256
- type CryptoSHA512
- type Db
- type DbGetUpdateHelper
- type DbInstance
- type DbPostgresInstance
- type DbTx
- type DbUpdateHelper
- type Err
- type Http
- type I9GCS
- type Json
- type Lock
- type Log
- type Server
- type Util
- type UtilEnv
- type UtilEnvBase64
- type UtilHashId
- type UtilMutex
- type UtilNMutex
- type XLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConvTime ¶
type ConvTime interface { ToStr(tm time.Time, format string) string ToStrDate(tm time.Time) string ToStrFull(tm time.Time) string ToStrMillis(tm time.Time) string ToStrMicro(tm time.Time) string ToStrRFC3339(tm time.Time) string ToStrRFC3339MilliSecond(tm time.Time) string ToStrRFC3339MicroSecond(tm time.Time) string ToTime(layout string, value string) (tm time.Time, err error) ToTimeDate(value string) (time.Time, error) ToTimeFull(value string) (time.Time, error) ToTimeMillis(value string) (time.Time, error) ToTimeMicro(value string) (time.Time, error) ToTimeRFC3339(value string) (time.Time, error) ToTimeRFC3339MilliSecond(value string) (time.Time, error) ToTimeRFC3339MicroSecond(value string) (time.Time, error) GetTimeZone(tm time.Time) string RemovePart(tm time.Time, part ...string) time.Time }
type CryptoAES ¶ added in v1.0.10
type CryptoAES interface { ECBEncrypt(key, value string) (string, error) ECBRawEncrypt(key, value string) ([]byte, error) ECBDecrypt(key, value string) (string, error) ECBRawDecrypt(key string, value []byte) ([]byte, error) }
https://www.devglan.com/online-tools/aes-encryption-decryption
type CryptoSHA256 ¶ added in v1.0.8
type CryptoSHA512 ¶ added in v1.1.47
type Db ¶
type Db interface { NewPostgresInstance(host string, port int, dbName, username, password string, schema *string, config *model.DbConfig, autoRebind, unsafeCompatibility bool, applicationName string, printSql bool, printUnsafeError bool) DbPostgresInstance NewReadWritePostgresInstance(read, write DbPostgresInstance) DbPostgresInstance }
type DbGetUpdateHelper ¶ added in v1.1.21
type DbGetUpdateHelper interface { Add(kv map[string]interface{}) DbGetUpdateHelper AddIfNotNilOrEmpty(kv map[string]interface{}) DbGetUpdateHelper Where(condition string, pars ...interface{}) DbGetUpdateHelper Get() (condition string, pars []interface{}) }
type DbInstance ¶
type DbInstance interface { Ping() error Execute(sqlQuery string, sqlPars ...interface{}) (string, error) ExecuteRID(sqlQuery string, sqlPars ...interface{}) (*int64, string, error) Select(out interface{}, sqlQuery string, sqlPars ...interface{}) error DirectSelect(rwForce bool, out interface{}, sqlQuery string, sqlPars ...interface{}) (*model.DbUnsafeSelectError, string, error) Get(rwForce bool, out interface{}, sqlQuery string, sqlPars ...interface{}) (string, error) NewTransaction() (DbTx, string, error) EmptyTransaction() (DbTx, string) OnUnsafe(unsafe *model.DbUnsafeSelectError) TxExecute(tx DbTx, sqlQuery string, sqlPars ...interface{}) (string, error) TxExecuteRID(tx DbTx, sqlQuery string, sqlPars ...interface{}) (*int64, string, error) TxSelect(tx DbTx, out interface{}, sqlQuery string, sqlPars ...interface{}) (*model.DbUnsafeSelectError, string, error) TxGet(tx DbTx, out interface{}, sqlQuery string, sqlPars ...interface{}) (string, error) }
type DbPostgresInstance ¶
type DbPostgresInstance interface { DbInstance }
type DbUpdateHelper ¶ added in v1.1.21
type DbUpdateHelper interface { SetAdd(condition string, param interface{}) SetAddIfNoNil(condition string, param interface{}) SetAddIfNotNilOrEmpty(condition string, param interface{}) Where(condition string, pars ...interface{}) MapSetAdd(kv map[string]interface{}) MapSetAddIfNotNilOrEmpty(kv map[string]interface{}) Get() (condition string, pars []interface{}) }
type Http ¶ added in v1.0.4
type Http interface { Get(url string, header map[string]interface{}, params map[string]interface{}, skipSecurityChecking bool, timeout *time.Duration) (result []byte, code int, err error) Post(url string, header map[string]interface{}, payload map[string]interface{}, skipSecurityChecking bool, timeout *time.Duration) (result []byte, code int, err error) PostData(url string, header map[string]interface{}, data []byte, skipSecurityChecking bool, timeout *time.Duration) (result []byte, code int, err error) PostFormData(url string, header map[string]string, files map[string]model.FileData, fields map[string]string) (result []byte, code int, err error) Delete(url string, header map[string]interface{}, params map[string]interface{}, skipSecurityChecking bool, timeout *time.Duration) (result []byte, code int, err error) }
type Util ¶
type Util interface { GetNanoID(length ...int) string GetID25() string GetXID25() string GetXID30() string GetXID40() string GetRandom(length int, value string) (string, error) GetRandomNumber(min, max int) int GetRandomAlphabet(length int) string GetRandomAlphabetLower(length int) string GetRandomAlphabetUpper(length int) string GetRandomAlphabetNumber(length int) string GetRandomDuration(min int, max int, base time.Duration) time.Duration BuildJwtToken(privateKey []byte, claims jwt.Claims) (string, error) BuildJwtTokenWithPassword(privateKey []byte, password string, claims jwt.Claims) (string, error) CreateJwtToken(subject, id string, expiresAt, issuedAt, notBefore time.Time, privateKey []byte) (string, error) CreateJwtTokenWithPassword(subject, id string, expiresAt, issuedAt, notBefore time.Time, privateKey []byte, password string) (string, error) GetJwtClaims(token string, publicKey []byte) (*jwt.RegisteredClaims, bool, error) Base64Encode(data []byte) string Base64Decode(value string) ([]byte, error) GetExecutionInfo(depth int) (execFunc string, execPath string) IsNumberOnly(value string, exclude ...string) bool ExtractPhoneNumber(phoneNumber *string) (countryId, countryCode, number string) IsEmailValid(email string, verifyDomain ...bool) bool ImageBase64Decoder(imageBase64 string) (buff bytes.Buffer, config image.Config, format string, err error) // ReflectionSet path: core.util.util-reflection-set.go ReflectionSet(obj interface{}, bind map[string]interface{}) error ReflectionGet(obj interface{}, fieldName string) (interface{}, error) ConcurrentProcess(total, max int, fn func(index int, activeProcess int)) UniqueConcurrentProcess(total, max int, key func(index int) *string, fn func(index int)) NewMutex(name string) UtilMutex NewNMutex(max int) UtilNMutex }
type UtilEnv ¶
type UtilEnv interface { GetAppEnv(key string) actenv.AppEnv GetStr(key string, defaultValue ...string) string GetInt(key string, defaultValue ...int) int GetInt32(key string, defaultValue ...int32) int32 GetInt64(key string, defaultValue ...int64) int64 GetFloat32(key string, defaultValue ...float32) float32 GetFloat64(key string, defaultValue ...float64) float64 GetBool(key string, defaultValue ...bool) bool GetBase64(key string) UtilEnvBase64 GetStrArr(key string, separator string, defaultValue ...[]string) []string GetMapStrStr(key string, keyValSeparator string, itemSeparator string, defaultValue ...map[string]string) map[string]string }
type UtilEnvBase64 ¶ added in v1.0.2
type UtilHashId ¶
type UtilMutex ¶ added in v1.1.41
type UtilMutex interface { Sleep(duration ...time.Duration) Lock(timeout ...time.Duration) (isTimeout bool) Unlock() Exec(timeout *time.Duration, fn func()) (executed bool, panicErr error) FExec(timeoutLock *time.Duration, timeoutFunc time.Duration, fn func()) (executed bool, isTimeout bool, panicErr error) Func(timeout time.Duration, fn func()) (isTimeout bool, panicErr error) }
type UtilNMutex ¶ added in v1.2.1
Click to show internal directories.
Click to hide internal directories.