Documentation
¶
Index ¶
- Constants
- Variables
- func Contains(str string, substr string) bool
- func CurrentDirectory() string
- func CurrentPath() string
- func Date(format string) string
- func Delete()
- func Equals(str1 string, str2 string) bool
- func Error(str string) error
- func FloatToInt(v float64) int
- func Get(url string, headers map[string]string) (string, error)
- func GetMsg(code int) string
- func IntToString(v int) string
- func Ip(str string) bool
- func IpAddr(str string) bool
- func IpV4(str string) bool
- func IpV4Addr(str string) bool
- func IpV6(str string) bool
- func IpV6Addr(str string) bool
- func IsDir(str string) bool
- func IsEmail(email string) bool
- func IsExist(f string) bool
- func IsFile(str string) bool
- func IsMobile(mobile string) bool
- func IsNumeric(num int) bool
- func IsURL(url string) bool
- func IsUnique(arr []rune) bool
- func JsonToMap(jsonStr string) map[string]interface{}
- func MapToJson(obj map[string]interface{}) string
- func Max(num int, max int) bool
- func Md5(str string) string
- func Min(num int, max int) bool
- func NotEqual(str1 string, str2 string) bool
- func OneOf(value interface{}, arr []rune) bool
- func Patch()
- func Post(url string, headers map[string]string, requestData string) (string, error)
- func Put()
- func Required(str string) bool
- func SendMail(to, subject, body, mailType string, conf *goconf.Config) error
- func StringToInt(str string) int
- func StructToJson(obj interface{}) string
- func StructToMap(obj interface{}) map[string]interface{}
- func TcpAddr(str string) bool
- func TcpV4Addr(str string) bool
- func TcpV6Addr(str string) bool
- func TrimS(str string) string
- func TypeOf(v interface{}) string
- func UdpAddr(str string) bool
- func UdpV4Addr(str string) bool
- func UdpV6Addr(str string) bool
- type Time
Constants ¶
View Source
const ( SUCCESS = 200 ERROR = 500 INVALID_PARAMS = 400 ERROR_EXIST_TAG = 10001 ERROR_EXIST_TAG_FAIL = 10002 ERROR_NOT_EXIST_TAG = 10003 ERROR_GET_TAGS_FAIL = 10004 ERROR_COUNT_TAG_FAIL = 10005 ERROR_ADD_TAG_FAIL = 10006 ERROR_EDIT_TAG_FAIL = 10007 ERROR_DELETE_TAG_FAIL = 10008 ERROR_EXPORT_TAG_FAIL = 10009 ERROR_IMPORT_TAG_FAIL = 10010 ERROR_NOT_EXIST_ARTICLE = 10011 ERROR_CHECK_EXIST_ARTICLE_FAIL = 10012 ERROR_ADD_ARTICLE_FAIL = 10013 ERROR_DELETE_ARTICLE_FAIL = 10014 ERROR_EDIT_ARTICLE_FAIL = 10015 ERROR_COUNT_ARTICLE_FAIL = 10016 ERROR_GET_ARTICLES_FAIL = 10017 ERROR_GET_ARTICLE_FAIL = 10018 ERROR_GEN_ARTICLE_POSTER_FAIL = 10019 ERROR_AUTH_CHECK_TOKEN_FAIL = 20001 ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002 ERROR_AUTH_TOKEN = 20003 ERROR_AUTH = 20004 ERROR_UPLOAD_SAVE_IMAGE_FAIL = 30001 ERROR_UPLOAD_CHECK_IMAGE_FAIL = 30002 ERROR_UPLOAD_CHECK_IMAGE_FORMAT = 30003 )
View Source
const (
TimeFormat = "2006-01-02 15:04:05"
)
Variables ¶
View Source
var MsgFlags = map[int]string{ SUCCESS: "ok", ERROR: "fail", INVALID_PARAMS: "请求参数错误", ERROR_EXIST_TAG: "已存在该标签名称", ERROR_EXIST_TAG_FAIL: "获取已存在标签失败", ERROR_NOT_EXIST_TAG: "该标签不存在", ERROR_GET_TAGS_FAIL: "获取所有标签失败", ERROR_COUNT_TAG_FAIL: "统计标签失败", ERROR_ADD_TAG_FAIL: "新增标签失败", ERROR_EDIT_TAG_FAIL: "修改标签失败", ERROR_DELETE_TAG_FAIL: "删除标签失败", ERROR_EXPORT_TAG_FAIL: "导出标签失败", ERROR_IMPORT_TAG_FAIL: "导入标签失败", ERROR_NOT_EXIST_ARTICLE: "该文章不存在", ERROR_ADD_ARTICLE_FAIL: "新增文章失败", ERROR_DELETE_ARTICLE_FAIL: "删除文章失败", ERROR_CHECK_EXIST_ARTICLE_FAIL: "检查文章是否存在失败", ERROR_EDIT_ARTICLE_FAIL: "修改文章失败", ERROR_COUNT_ARTICLE_FAIL: "统计文章失败", ERROR_GET_ARTICLES_FAIL: "获取多个文章失败", ERROR_GET_ARTICLE_FAIL: "获取单个文章失败", ERROR_GEN_ARTICLE_POSTER_FAIL: "生成文章海报失败", ERROR_AUTH_CHECK_TOKEN_FAIL: "Token鉴权失败", ERROR_AUTH_CHECK_TOKEN_TIMEOUT: "Token已超时", ERROR_AUTH_TOKEN: "Token生成失败", ERROR_AUTH: "Token错误", ERROR_UPLOAD_SAVE_IMAGE_FAIL: "保存图片失败", ERROR_UPLOAD_CHECK_IMAGE_FAIL: "检查图片失败", ERROR_UPLOAD_CHECK_IMAGE_FORMAT: "校验图片错误,图片格式或大小有问题", }
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.