Documentation
¶
Index ¶
- func Base64ToImage(imageBase64 string) ([]byte, error)
- func CheckPermission(src string) bool
- func GetCurrentTimeStamp() int64
- func GetDirFiles(dir string) ([]string, error)
- func GetExt(fileName string) string
- func GetImgType(p string) (string, error)
- func GetSize(f multipart.File) (int, error)
- func GetType(p string) (string, error)
- func GetUUID() string
- func Hmac(data string) string
- func IsNotExistMkDir(src string) error
- func IsStringEmpty(str string) bool
- func MkDir(src string) error
- func NotExist(src string) bool
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func PathExists(path string) bool
- func RemoveRepByMap(slc []string) []string
- type APIException
- type JSONTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64ToImage ¶
func GetCurrentTimeStamp ¶
func GetCurrentTimeStamp() int64
func GetDirFiles ¶
func IsStringEmpty ¶
func NotExist ¶
NotExist reports whether nothing is at src.
It was called CheckExist and documented as checking existence while returning the opposite, so its one caller compensated by inverting twice. Renamed rather than corrected in place: a caller who had worked the real behaviour out gets a compile error instead of a silent inversion.
func Open ¶
Open 打开文件
The caller owns the file and closes it. Closing it here — which a deferred call did — handed back a file that was already closed.
func PathExists ¶
func RemoveRepByMap ¶
RemoveRepByMap returns slc without its duplicates, keeping first order.
Types ¶
type APIException ¶
type APIException struct {
Code int `json:"code"`
Success bool `json:"success"`
Msg string `json:"msg"`
Timestamp int64 `json:"timestamp"`
Result interface{} `json:"result"`
}
api结构体
func ResponseJson ¶
func ResponseJson(message string, data interface{}, success bool) *APIException
200
type JSONTime ¶
JSONTime format json time field by myself
func (JSONTime) MarshalJSON ¶
MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S