Documentation
¶
Index ¶
- func Between(lang string, number string) string
- func Bool(lang string) string
- func CheckFile(r *http.Request) *govalidator.Validator
- func CheckPasswordHash(password, hash string) bool
- func ClearText(text string) string
- func ConvertImageToBase(g *gin.Context, filepath string) (bool, string)
- func DbTruncate(tableName ...string)
- func DecodeAndReturn(req *http.Request, structBind interface{}) (interface{}, error)
- func DecodeImage(g *gin.Context, filename string) (bool, string)
- func Digits(lang string) string
- func DoneActivate(g *gin.Context) string
- func DoneActivationPack(g *gin.Context, activateCount int, deactivateCount int) string
- func DoneCreateItem(g *gin.Context) string
- func DoneDeactivate(g *gin.Context) string
- func DoneDelete(g *gin.Context) string
- func DoneGetAllItems(g *gin.Context) string
- func DoneGetItem(g *gin.Context) string
- func DoneTrash(g *gin.Context) string
- func DoneUpdate(g *gin.Context) string
- func Email(lang string) string
- func Ext(lang string, extentions string) string
- func GenerateToken(stringToHash string) (string, error)
- func GetCurrentLang(g *gin.Context) string
- func GetCurrentLangFromHttp(r *http.Request) string
- func HashPassword(password string) (string, error)
- func In(lang string, ableStrings ...string) string
- func IntSlice(lang string) string
- func ItemNotFound(g *gin.Context) string
- func LangHeader(g *gin.Context) string
- func Limit(g *gin.Context) int
- func Max(lang string, number string) string
- func Mime(lang string, extentions string) string
- func Min(lang string, number string) string
- func MultiDecodeImage(g *gin.Context, images []string) []string
- func MultiUploadError(g *gin.Context)
- func NotValidExt(lang string) string
- func Numeric(lang string) string
- func OkResponse(g *gin.Context, msg string, data interface{})
- func OkResponseWithOutData(g *gin.Context, msg string)
- func OkResponseWithPaging(g *gin.Context, msg string, data *Paginator)
- func Order(g *gin.Context, order ...string) []string
- func Page(g *gin.Context) int
- func PreloadD(db *gorm.DB, preload []string) *gorm.DB
- func RandomString(n int) string
- func ReadAllFiles(root string) []string
- func Required(lang string) string
- func ReturnBadRequest(g *gin.Context)
- func ReturnDuplicateData(g *gin.Context, inputName string)
- func ReturnForbidden(g *gin.Context, msg string)
- func ReturnNotFound(g *gin.Context, msg string)
- func ReturnNotValidFile(err error, g *gin.Context)
- func ReturnNotValidRequest(error *govalidator.Validator, g *gin.Context) bool
- func ReturnNotValidRequestFile(error *govalidator.Validator, g *gin.Context) bool
- func ReturnNotValidRequestFormData(error *govalidator.Validator, g *gin.Context) bool
- func ReturnResponseWithMessageAndStatus(g *gin.Context, statusHttp int, message string, status bool)
- func ReturnYouAreNotAuthorize(g *gin.Context)
- func SendMail(email string, subject string, content string)
- func Size(lang string, size string) string
- func StringsSlice(lang string) string
- func T(g *gin.Context, key ...string) string
- func ToSnakeCase(str string) string
- func Unique(lang string, key ...string) string
- func UpdateOnlyAllowColumns(structNeedToMap interface{}, fillAble []string) interface{}
- func UploadError(g *gin.Context)
- func UploadImage(g *gin.Context, fileString string) (bool, string)
- func UploadImages(g *gin.Context, fileString string) (bool, []string)
- func Url(lang string) string
- func ValidCsvFile(g *gin.Context) string
- func Wrong(g *gin.Context) string
- type Paginator
- type Param
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
* * check if password is valid
func ConvertImageToBase ¶
* * convert image to to base 64
func DecodeAndReturn ¶
* * decode body then return interface
func DecodeImage ¶
* * Decode Image and save it on path
func DoneActivate ¶
func DoneActivationPack ¶
func DoneCreateItem ¶
func DoneDeactivate ¶
func DoneDelete ¶
func DoneGetAllItems ¶
func DoneGetItem ¶
func DoneUpdate ¶
func GenerateToken ¶
* * generate token based on user data
func GetCurrentLang ¶
func GetCurrentLangFromHttp ¶
func ItemNotFound ¶
func NotValidExt ¶
func OkResponse ¶
* * ok response with data
func OkResponseWithOutData ¶
* * ok response without data
func OkResponseWithPaging ¶
* * ok with paging
func ReadAllFiles ¶
* * return with []strings that contains * files names inside path what you set
func ReturnDuplicateData ¶
* * Duplicate data
func ReturnNotValidFile ¶
* * NotValidRequest file
func ReturnNotValidRequest ¶
func ReturnNotValidRequest(error *govalidator.Validator, g *gin.Context) bool
* * NotValidRequest response
func ReturnNotValidRequestFile ¶
func ReturnNotValidRequestFile(error *govalidator.Validator, g *gin.Context) bool
* * NotValidFile response
func ReturnNotValidRequestFormData ¶
func ReturnNotValidRequestFormData(error *govalidator.Validator, g *gin.Context) bool
* * NotValidRequest response
func ReturnResponseWithMessageAndStatus ¶
func ReturnResponseWithMessageAndStatus(g *gin.Context, statusHttp int, message string, status bool)
* * global response
func StringsSlice ¶
func ToSnakeCase ¶
func UpdateOnlyAllowColumns ¶
func UpdateOnlyAllowColumns(structNeedToMap interface{}, fillAble []string) interface{}
* * this function get struct and return with only * Available column that allow to updated depend on FillAbleColumn function * this for security * map struct to update
func UploadImage ¶
** * upload file with input name * if there are resize width height * it will resize image with this sizes
func UploadImages ¶
** * upload file with input name * if there are resize width height * it will resize image with this sizes
func ValidCsvFile ¶
Types ¶
type Paginator ¶
type Paginator struct { TotalRecord int `json:"total_record"` TotalPage int `json:"total_page"` Records interface{} `json:"records"` Offset int `json:"offset"` Limit int `json:"limit"` Page int `json:"page"` PrevPage int `json:"prev_page"` NextPage int `json:"next_page"` }
Paginator 分页返回