Documentation
¶
Index ¶
- Constants
- Variables
- func AvoidXSS(theHTML string) string
- func DeepFields(ifaceType reflect.Type) []reflect.StructField
- func GetFileMsg(file *multipart.FileHeader) (string, []byte, error)
- func GetIntFromEnv(key string, v int) int
- func GetInterfaceType(value interface{}) string
- func GetStringFromEnv(key string, v string) string
- func GetTodayTime() time.Time
- func GetTodayYM(sep string) string
- func GetTodayYMD(sep string) string
- func GetTomorrowYMD(sep string) string
- func GetYesterdayTime() time.Time
- func GetYesterdayYMD(sep string) string
- func GormBatchInsert(db *gorm.DB, values interface{}, validColList []string, ...) error
- func Interface2String(value interface{}) string
- func LuosimaoVerify(reqURL, apiKey, response string) error
- func Paginator(page, prepage int, nums int64) map[string]interface{}
- func RelativeURLToAbsoluteURL(curURL string, baseURL string) (string, error)
- func SaveFile(filePath string, content []byte) error
- func SendErrJSON(msg string, args ...interface{})
- func SetStructByJSON(obj interface{}, mapData map[string]interface{}) error
- func StrToIntMonth(month string) int
- func String2Interface(value string, vtype string) (interface{}, error)
- func StructCopy(DstStructPtr interface{}, SrcStructPtr interface{})
- func VarsOption(vars map[string]interface{}) client.Option
- type JSON
Constants ¶
View Source
const DateTimeFormat = "2006-01-02 15:04:05"
DateTimeFormat 时间转换格式
Variables ¶
View Source
var ErrorCode = errorCode{
SUCCESS: 0,
ERROR: 1,
NotFound: 404,
LoginError: 1000,
LoginTimeout: 1001,
InActive: 1002,
}
ErrorCode �错误码
View Source
var LOC, _ = time.LoadLocation("Local")
Functions ¶
func DeepFields ¶
func DeepFields(ifaceType reflect.Type) []reflect.StructField
func GetFileMsg ¶
func GetFileMsg(file *multipart.FileHeader) (string, []byte, error)
GetFileMsg ...
func GetIntFromEnv ¶
func GetInterfaceType ¶
func GetInterfaceType(value interface{}) string
func GetStringFromEnv ¶
func GetYesterdayYMD ¶
GetYesterdayYMD 得到以sep为分隔符的年、月、日字符串(昨天)
func GormBatchInsert ¶
func GormBatchInsert(db *gorm.DB, values interface{}, validColList []string, invalidList map[string]interface{}) error
批量插入数据 values 参数必须为 数组, validColList 为想插入的字段
func Interface2String ¶
func Interface2String(value interface{}) string
func LuosimaoVerify ¶
LuosimaoVerify 对前端的验证码进行验证
func RelativeURLToAbsoluteURL ¶
RelativeURLToAbsoluteURL 相对URL转绝对URL
func SetStructByJSON ¶
SetStructByJSON 由json对象生成 struct
func String2Interface ¶
func StructCopy ¶
func StructCopy(DstStructPtr interface{}, SrcStructPtr interface{})
func VarsOption ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.