Documentation ¶
Index ¶
- Constants
- Variables
- func ActionLogs(c echo.Context, t string, accountId int64) map[string]interface{}
- func ActionLogsMap(c echo.Context, t, remarks string, accountId int64) map[string]interface{}
- func Alert(c echo.Context, tip string) error
- func AuthFail(c echo.Context, msg string) error
- func AuthFailNull(c echo.Context) error
- func AuthWechatFailNull(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 CheckMax(value interface{}, max float64) bool
- func CheckMaxSize(value interface{}, maxSize int) bool
- func CheckMin(value interface{}, min float64) bool
- func CheckMinSize(value interface{}, minSize 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 Cmd(c Command) error
- func CreateFile(path string) (*os.File, error)
- func CreateQrCode(url string) (string, error)
- func CreateQrCodeBytes(url string) (bytes.Buffer, 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 FormatTime(t time.Time) string
- func GetIp() string
- func GetMac() string
- func GetPageIndex(pi string) int
- func GetPageSize(ps string) int
- func ID() int64
- func IsArray(value interface{}) 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 New() string
- func NewLen(length int) string
- func NewLenChars(length int, chars []byte) string
- func NullData(c echo.Context) error
- func Open(uri string) error
- func PathExists(path string) (bool, 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
- type Command
- type IdWorker
- type Image
- type PageData
- type PageTable
- type Random
- type ResultParam
- type SmsClient
Constants ¶
View Source
const ( // Standard length of uniuri string to achive ~95 bits of entropy. StdLen = 16 // Length of uniurl string to achive ~119 bits of entropy, closest // to what can be losslessly converted to UUIDv4 (122 bits). UUIDLen = 20 )
View Source
const ( //成功 SUCCESS_CODE = 200 //错误 ERROR_CODE = 400 //授权失败 AUTH_FAIL = 401 //登陆无效 LOGIN_INVALID_CODE = 402 //失败 FAIL_DATA = 403 //数据为空 NULL_DATA = 404 //不是会员 NOT_MEMBER = 500 //会员续费通知 MEMBER_RENEW = 501 AUTH_WECHAT_FAIL = 5401 )
View Source
const ( DistrictIdBits = uint(2) //区域 所占用位置 NodeIdBits = uint(4) //节点 所占位置 DistrictIdShift = sequenceBits + NodeIdBits )
View Source
const PAGE_SIZE = 10
Variables ¶
View Source
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
Standard characters allowed in uniuri string.
Functions ¶
func ActionLogsMap ¶
func AuthFailNull ¶
func AuthWechatFailNull ¶
func CheckFloat64Range ¶
检查float数据的区间(开区间)
func CheckMaxSize ¶
检查传入的值的长度,仅支持string、slice或者map 计算String的时候,以正则实现,中文字符算长度1
func CheckMinSize ¶
检查传入的值的长度,仅支持string、slice或者map 计算String的时候,以正则实现,中文字符算长度1
func CheckRegexp ¶
根据正则检查字符串,如果传入的不是string类型,则使用Sprintf处理成字符串再校验。
func CreateQrCode ¶
func CurrentDate ¶
func CurrentDate() string
func CurrentDateByPlace ¶
func CurrentTime ¶
func CurrentTime() string
func FormatTime ¶
func GetPageIndex ¶
func GetPageSize ¶
func IsValidBoolean ¶
检查字符串是否代表一个合法的bool值 注意返回值仅表示是不是布尔值,并不表示布尔值本身的含义
func IsValidDate ¶
func IsValidTime ¶
func IsWechatBrowser ¶
func JsonParentPath ¶
func MobileReplaceRepl ¶
func New ¶
func New() string
New returns a new random string of the standard length, consisting of standard characters.
func NewLen ¶
NewLen returns a new random string of the provided length, consisting of standard characters.
func NewLenChars ¶
NewLenChars returns a new random string of the provided length, consisting of the provided byte slice of allowed characters (maximum 256).
func PathExists ¶
func SubStrByByte ¶
func SubStrByByteInChar ¶
func SuccessNullMsg ¶
Types ¶
type IdWorker ¶
type IdWorker struct {
// contains filtered or unexported fields
}
var UUID *IdWorker
func NewIdWorker ¶
NewIdWorker new a snowflake id generator object.
type Random ¶
type Random struct{}
Random random
func (Random) NumberByFloat ¶
func (Random) NumberByInt ¶
type ResultParam ¶
type ResultParam struct { Ret int64 `json:"ret"` Msg string `json:"msg"` Data interface{} `json:"data"` }
func ToResultParam ¶
func ToResultParam(b []byte) ResultParam
type SmsClient ¶
type SmsClient struct { Request *model.ALiYunCommunicationRequest GatewayUrl string Client *http.Client }
func NewSmsClient ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.