Documentation ¶
Index ¶
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(data, key []byte) ([]byte, error)
- func CombineErrors(errs ...error) error
- func CombineUpdateSetMap(keys []string, values []any) map[string]any
- func DatetimeFormat(datetime *string, format string) error
- func DatetimesFormat(datetimes *[]*string, format string) error
- func DecryptArrayToInt(data int64, length int) []bool
- func EncryptArrayToInt(array []bool) int64
- func GetPoint[T string | int | int64 | float64 | bool](obj T) *T
- func GetRandomPassword(length int) string
- func HasValueFromSlice[T int | float64](array *[]*T, value *T) (result bool)
- func HasValueFromSliceForInt(array *[]*int, value *int) (result bool)
- func HasValueFromSliceForString(array *[]*string, value *string) (result bool)
- func MysqlDelete(database *sqlx.DB, response **BaseResponse, table *string, ...)
- func MysqlPost(database *sqlx.DB, response **BaseResponse, table *string, columns *[]string, ...)
- func MysqlPut(database *sqlx.DB, response **BaseResponse, table *string, ...)
- func MysqlRetrieveDetail(database *sqlx.DB, response **BaseResponse, table *string, fields *[]string, ...)
- func MysqlRetrieveList(database *sqlx.DB, response **BaseResponse, table *string, fields *[]string, ...)
- func MysqlRetrieveTotal(database *sqlx.DB, response **BaseResponse, table *string, field *string, ...)
- func PKCS7Padding(text []byte, size int) []byte
- func PKCS7UnPadding(data []byte) []byte
- func ReflectTags(obj any, tag string) *[]string
- func ReflectValues(obj any) *[]any
- func ReturnResponse(ctx iris.Context, baseResponse *BaseResponse)
- type BaseResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶ added in v0.3.0
AesDecrypt decrypt data
func AesEncrypt ¶ added in v0.3.0
AesEncrypt encrypt data
func CombineErrors ¶ added in v0.4.20
CombineErrors combile errors
func CombineUpdateSetMap ¶
CombineUpdateSetMap combine two array to a map for update's set method
func DatetimeFormat ¶
DatetimeFormat format a datetime
func DatetimesFormat ¶
DatetimesFormat format datetimes
func DecryptArrayToInt ¶
DecryptArrayToInt decrypt int64 to array
func EncryptArrayToInt ¶
EncryptArrayToInt encrypt array to int64
func GetRandomPassword ¶ added in v0.4.13
GetRandomPassword get password
func HasValueFromSlice ¶ added in v0.3.0
HasValueFromSlice has value from slice
func HasValueFromSliceForInt ¶ added in v0.2.2
HasValueFromSliceForInt has value from slice
func HasValueFromSliceForString ¶ added in v0.2.2
HasValueFromSliceForString has value from slice
func MysqlDelete ¶ added in v0.4.10
func MysqlDelete( database *sqlx.DB, response **BaseResponse, table *string, data *map[string]any, where *squirrel.And, )
MysqlDelete delete data from mysql
func MysqlPost ¶ added in v0.4.5
func MysqlPost( database *sqlx.DB, response **BaseResponse, table *string, columns *[]string, values *[]any, id *int64, )
MysqlPost post data to mysql
func MysqlPut ¶ added in v0.4.9
func MysqlPut( database *sqlx.DB, response **BaseResponse, table *string, data *map[string]any, where *squirrel.And, )
MysqlPut put data from mysql
func MysqlRetrieveDetail ¶ added in v0.4.5
func MysqlRetrieveDetail( database *sqlx.DB, response **BaseResponse, table *string, fields *[]string, where *squirrel.And, data any, )
MysqlRetrieveDetail retrieve detail from mysql
func MysqlRetrieveList ¶ added in v0.4.5
func MysqlRetrieveList( database *sqlx.DB, response **BaseResponse, table *string, fields *[]string, where *squirrel.And, orderBy *[]string, limit *uint64, offset *uint64, data any, )
MysqlRetrieveList retrieve list from mysql
func MysqlRetrieveTotal ¶ added in v0.4.5
func MysqlRetrieveTotal( database *sqlx.DB, response **BaseResponse, table *string, field *string, where *squirrel.And, data any, )
MysqlRetrieveTotal retrieve total from mysql
func PKCS7Padding ¶ added in v0.3.0
PKCS7Padding encrypt bytes
func PKCS7UnPadding ¶ added in v0.3.0
PKCS7UnPadding decrypt bytes
func ReturnResponse ¶
func ReturnResponse(ctx iris.Context, baseResponse *BaseResponse)
ReturnResponse response get to the client
Types ¶
type BaseResponse ¶
BaseResponse is struct
func BuildResponseBuildSQLWrong ¶
func BuildResponseBuildSQLWrong(err *error) *BaseResponse
BuildResponseBuildSQLWrong return a build sql wrong response
func BuildResponseExecuteSQLWrong ¶
func BuildResponseExecuteSQLWrong(err *error) *BaseResponse
BuildResponseExecuteSQLWrong return a execute sql wrong response
func BuildResponseGet ¶
func BuildResponseGet(body *iris.Map) *BaseResponse
BuildResponseGet return a get response
func BuildResponseParametersWrong ¶
func BuildResponseParametersWrong(err *error) *BaseResponse
BuildResponseParametersWrong return a parameters wrong response
func BuildResponseUnexpectedWrong ¶
func BuildResponseUnexpectedWrong(err *error) *BaseResponse
BuildResponseUnexpectedWrong return a unexpected wrong response