Documentation
¶
Index ¶
- type CheckStr
- type Conv
- type ConvProto
- type ConvTime
- type CryptoAES
- type CryptoMD5
- type CryptoSHA256
- type Db
- type DbGetUpdateHelper
- type DbInstance
- type DbPostgresInstance
- type DbTx
- type DbUpdateHelper
- type Err
- type Http
- type I9GCS
- type Json
- type Log
- type Server
- type Util
- type UtilEnv
- type UtilEnvBase64
- type UtilHashId
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 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) 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{}) error ExecuteRID(sqlQuery string, sqlPars ...interface{}) (*int64, error) Select(out interface{}, sqlQuery string, sqlPars ...interface{}) (*model.DbUnsafeSelectError, error) Get(out interface{}, sqlQuery string, sqlPars ...interface{}) error NewTransaction() (DbTx, error) TxExecute(tx DbTx, sqlQuery string, sqlPars ...interface{}) error TxExecuteRID(tx DbTx, sqlQuery string, sqlPars ...interface{}) (*int64, error) TxSelect(tx DbTx, out interface{}, sqlQuery string, sqlPars ...interface{}) (*model.DbUnsafeSelectError, error) TxGet(tx DbTx, out interface{}, sqlQuery string, sqlPars ...interface{}) 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{}, payload 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) Delete(url string, header map[string]interface{}, params map[string]interface{}, skipSecurityChecking bool, timeout *time.Duration) ([]byte, int, error) }
type Util ¶
type Util interface { GetNanoID(length ...int) string GetID25() string GetRandom(length int, value string) (string, error) 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.StandardClaims, 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 ConcurrentProcess(total, max int, fn func(index int)) }
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 }
type UtilEnvBase64 ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.