Documentation ¶
Index ¶
- Constants
- func Alert(c echo.Context, tip string) error
- func AuthFail(c echo.Context, msg string) error
- func AuthFailNull(c echo.Context) error
- func AuthFailOrgNull(c echo.Context) error
- func CheckEmail(value interface{}) bool
- func CheckFloat64Range(value interface{}, min, max float64) bool
- func CheckIPv4(value interface{}) bool
- func CheckIntRange(value interface{}, min, max int) bool
- func CheckLen(value interface{}, length int) bool
- func CheckMobile(value interface{}) bool
- func CheckRealNumber(value interface{}) bool
- func CheckRegexp(value interface{}, rex string) bool
- func CheckType(value interface{}, expectType string) bool
- func Confirm(c echo.Context, msg string, data interface{}) error
- func ConfirmNUll(c echo.Context, msg string) error
- func Contains(strs []string, str string) bool
- func ContainsInt64(strs []int64, str int64) bool
- func CreateFile(path string) (*os.File, error)
- func CurrentDate() string
- func CurrentDateByPlace(place string) string
- func CurrentDirectory() string
- func CurrentTime() string
- func Error(c echo.Context, msg string, data interface{}) error
- func ErrorNull(c echo.Context, msg string) error
- func FormatMonth(t time.Time) string
- func FormatMonthChinese(t time.Time) string
- func FormatTime(t time.Time) string
- func GetFuncName() string
- func GetPageIndex(pi string) int
- func GetPageNumber(count, pageSize int) int
- func GetPageSize(ps string) int
- func GetRand() string
- func ID() int64
- func IDString() string
- func ImgCodeFail(c echo.Context) error
- func ImgCodeNUll(c echo.Context) error
- func IsArray(value interface{}) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsMobile(s string) bool
- func IsUrl(url string) bool
- func IsValidBoolean(s string) bool
- func IsValidDate(s string) bool
- func IsValidNumber(s string) bool
- func IsValidTime(s string) bool
- func IsWechatBrowser(userAgent string) bool
- func JsonParentPath(params ...string) string
- func JsonPath(params ...string) string
- func MkdirAll(path string) error
- func MobileReplaceRepl(str string) string
- func NullData(c echo.Context) error
- func ParamsError(c echo.Context, data interface{}) error
- func ParseDate(date string) (time.Time, error)
- func ParseExcelDate(date string) (d *time.Time, err error)
- func ParseTime(date string) (time.Time, error)
- func PathExists(path string) (bool, error)
- func PermissionDenied(c echo.Context) error
- func Read(path string) string
- func ReadByte(path string) []byte
- func Redirect(c echo.Context, url string) error
- func RedirectAndAlert(c echo.Context, tip, url string) error
- func Result(c echo.Context, ret int64, msg string, data interface{}) error
- func ResultApi(c echo.Context, data interface{}) error
- func ResultHtml(c echo.Context, html string) error
- func ResultString(c echo.Context, str string) error
- func Separator() string
- func SubStrByByte(str string, length int) string
- func SubStrByByteInChar(str string, length int) string
- func Substr(s string, pos, length int) string
- func Success(c echo.Context, msg string, data interface{}) error
- func SuccessNull(c echo.Context, msg string) error
- func SuccessNullMsg(c echo.Context, data interface{}) error
- func SuccessRespone(c echo.Context, data string) error
- func Trim(str string) string
- func TrimHtml(src string) string
- type Count
- type CustomBinder
- type PageData
- type PageTable
- type RandID
- type Random
- type ResultParam
Constants ¶
View Source
const ( //成功 SuccessCode = 200 //错误 ErrorCode = 400 //授权失败 AuthFailCode = 401 //参数校验失败 ParamsErrorCode = 402 //权限不足 PermissionDeniedCode = 403 //数据为空 NullDataCode = 404 //图片验证码为空 ImgCodeNull = 500 //图片验证码错误 ImgCodeFailCode = 501 //询问 ConfirmCode = 700 )
View Source
const ( GetParsFailResult = "获取参数失败" ParsFailResult = "参数校验失败" GetDataNullResult = "数据不存在" GetDataFailResult = "获取数据失败" AddSuccessResult = "添加成功" UpdateSuccessResult = "修改成功" DeleteSuccessResult = "删除成功" AddFailResult = "添加失败" UpdateFailResult = "修改失败" DeleteFailResult = "删除失败" GetFailResult = "获取失败" )
View Source
const PageSize = 10
Variables ¶
This section is empty.
Functions ¶
func AuthFailNull ¶
func AuthFailOrgNull ¶
func CheckFloat64Range ¶
检查float数据的区间(开区间)
func CheckRegexp ¶
根据正则检查字符串,如果传入的不是string类型,则使用Sprintf处理成字符串再校验。
func ContainsInt64 ¶
func CurrentDate ¶
func CurrentDate() string
func CurrentDateByPlace ¶
func CurrentTime ¶
func CurrentTime() string
func FormatMonth ¶
func FormatMonthChinese ¶
func FormatTime ¶
func GetFuncName ¶
func GetFuncName() string
func GetPageIndex ¶
func GetPageNumber ¶
func GetPageSize ¶
func ImgCodeFail ¶
func ImgCodeNUll ¶
func IsValidBoolean ¶
检查字符串是否代表一个合法的bool值 注意返回值仅表示是不是布尔值,并不表示布尔值本身的含义
func IsValidDate ¶
func IsValidTime ¶
func IsWechatBrowser ¶
func JsonParentPath ¶
func MobileReplaceRepl ¶
func ParamsError ¶
func ParseExcelDate ¶
转换excel中日期字符串(有可能为数字格式的字符串)
func PathExists ¶
func PermissionDenied ¶
func SubStrByByte ¶
func SubStrByByteInChar ¶
func SuccessNullMsg ¶
Types ¶
type CustomBinder ¶
type CustomBinder struct{}
type PageData ¶
type PageData struct { PageIndex int `json:"pageNo"` PageSize int `json:"pageSize"` PageNumber int `json:"pageNum"` Count int `json:"totalCount"` Data interface{} `json:"data"` }
type ResultParam ¶
type ResultParam struct { Ret int64 `json:"ret"` Msg string `json:"msg"` Data interface{} `json:"data"` }
func ToResultParam ¶
func ToResultParam(b []byte) ResultParam
Source Files ¶
Click to show internal directories.
Click to hide internal directories.