Documentation ¶
Index ¶
- Constants
- func Base64ToImage(imageBase64 string) ([]byte, error)
- func Black(msg string) string
- func Blue(msg string) string
- func CheckExist(src string) bool
- func CheckPermission(src string) bool
- func Cyan(msg string) string
- func FileCreate(content bytes.Buffer, name string)
- func FileMonitoringById(ctx context.Context, filePth string, id string, group string, ...)
- func GenerateRandomKey16() string
- func GenerateRandomKey20() string
- func GenerateRandomKey6() string
- func GetCurrentPath() string
- func GetCurrentTime() time.Time
- func GetCurrentTimeStamp() int64
- func GetCurrentTimeStr() string
- func GetDirFiles(dir string) ([]string, error)
- func GetExt(fileName string) string
- func GetFileSize(filename string) int64
- func GetImgType(p string) (string, error)
- func GetLocaHonst() string
- func GetLocation(ip, key string) string
- func GetSize(f multipart.File) (int, error)
- func GetType(p string) (string, error)
- func GetUUID() string
- func Green(msg string) string
- func Hmac(data string) string
- func HttpGetJson(url string, param map[string]string, header map[string]string, ...) error
- func HttpPostJson(url string, param map[string]interface{}, header map[string]string, ...) error
- func HttpPostXml(url string, param url.Values, header ...map[string]string) ([]byte, error)
- func If(flag bool, a, b interface{}) interface{}
- func IsNotExistMkDir(src string) error
- func IsStringEmpty(str string) bool
- func Magenta(msg string) string
- func MkDir(src string) error
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func PathCreate(dir string) error
- func PathExist(addr string) bool
- func PathExists(path string) bool
- func Red(msg string) string
- func RemoveRepByMap(slc []string) []string
- func SetColor(msg string, conf, bg, text int) string
- func SetPassword(password string, salt string) (verify string, err error)
- func StringToInt(e string) (int, error)
- func StructToJsonStr(e interface{}) (string, error)
- func Translate(form, to interface{})
- func White(msg string) string
- func Yellow(msg string) string
- type APIException
- type JSONTime
- type ReplaceHelper
Constants ¶
View Source
const ( TextBlack = iota + 30 TextRed TextGreen TextYellow TextBlue TextMagenta TextCyan TextWhite )
Variables ¶
This section is empty.
Functions ¶
func Base64ToImage ¶
func FileCreate ¶
func FileMonitoringById ¶
func GetCurrentTime ¶
func GetCurrentTimeStamp ¶
func GetCurrentTimeStamp() int64
func GetCurrentTimeStr ¶
func GetCurrentTimeStr() string
func GetDirFiles ¶
func HttpGetJson ¶ added in v1.7.3
func HttpPostJson ¶ added in v1.7.3
func HttpPostXml ¶ added in v1.7.3
func IsStringEmpty ¶
func PathCreate ¶
func PathExists ¶
func SetPassword ¶
SetPassword 根据明文密码和加盐值生成密码
func StringToInt ¶
func StructToJsonStr ¶
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
type ReplaceHelper ¶
func (*ReplaceHelper) DoWrok ¶
func (h *ReplaceHelper) DoWrok() error
Click to show internal directories.
Click to hide internal directories.