Documentation ¶
Index ¶
- func Assert(isAs bool, errMsg string)
- func AssertEmpty(isNull interface{}, errMsg string)
- func AssertError(err error)
- func GetCurrentGoroutineID() int
- func GetStack() string
- func IsDay(a time.Time, b time.Time) bool
- func IsLittleEndian() bool
- func JSONSerialize(obj interface{}) string
- func JSONUnFormSerialize(data string, v interface{}) error
- func JSONUnSerialize(data []byte, v interface{}) error
- func RandStr(length int) string
- func SpawnUUID() string
- func SubStr(str string, start int, length int) string
- func SubStr2(str string, start int, end int) string
- func Timestamp() int64
- func TimestampDay() int64
- func TimestampFormat() string
- func ToDate(tm string) time.Time
- func ToDateTime(tm string) time.Time
- func ToDay(tm time.Time) int64
- func ToTimeFormat(t time.Time) string
- func ToTimeFormatPoint(t *time.Time) string
- func ToTimestamp(t time.Time) int64
- func ToTimestampPoint(t *time.Time) int64
- func VerifyAccountFormat(account string) bool
- func VerifyCaptchaFormat(captcha string) bool
- func VerifyEmailFormat(email string) bool
- func VerifyMobileFormat(mobileNum string) bool
- func VerifyPasswordFormat(pwd string) bool
- type Application
- type Daemon
- type SensitiveMap
- type SignalWatch
- type SnowFlake
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert Assert boolean and output error message @Method Assert @Param (bool) false assert @Param (string) error message
func AssertEmpty ¶
func AssertEmpty(isNull interface{}, errMsg string)
AssertEmpty Assert Nil and output an error message @Method AssertEmtpy @Param (interface{}) is null assert @Param (string) error message
func GetCurrentGoroutineID ¶
func GetCurrentGoroutineID() int
GetCurrentGoroutineID doc @Method GetCurrentGoroutineID @Summary Return the ID of the current coroutine @Return (int)
func GetStack ¶
func GetStack() string
GetStack Return current stack information @Method GetStack @Return (string)
func IsLittleEndian ¶
func IsLittleEndian() bool
IsLittleEndian doc @Method IsLittleEndian @Summary Determine if the system is a small endian @Return (bool)
func JSONSerialize ¶
func JSONSerialize(obj interface{}) string
JSONSerialize doc @Method JSONSerialize @Summary golang object Serialized to json string @Param (interface{}) json object @Return (string) json string
func JSONUnFormSerialize ¶
JSONUnFormSerialize doc @Method JSONUnFormSerialize @Summary Reverse the json string into a golang object @Param (string) json string @Param (interface{}) out json object
func JSONUnSerialize ¶
JSONUnSerialize doc @Method JSONUnSerialize @Summary Reverse the json string [byte] into a golang object @Param ([]byte) json []byte @Param (interface{}) out json object @Return (error)
func RandStr ¶
RandStr doc @Method RandStr doc : Randomly generate a string of length n @Param (int) length @Return (string)
func SpawnUUID ¶
func SpawnUUID() string
SpawnUUID doc @Method SpawnUUID @Summary spawn uuid @Return (string) uuid
func SubStr ¶
SubStr doc @Method SubStr @SummaryCut string ends with length @Param (string) source string @Param (int) start pos @Param (int) sub length @Return (string) sub string
func SubStr2 ¶
SubStr2 doc @Method SubStr2 doc : Cut string ends with index @Param (string) source string @Param (int) start pos @Param (int) end pos @Return (string) sub string
func TimestampDay ¶ added in v1.1.0
func TimestampDay() int64
TimestampDay Returns 当前时间日时间间戳,用户潘盾是否是同一天
func TimestampFormat ¶ added in v1.1.0
func TimestampFormat() string
TimestampFormat Returns 当前时间字符串 @Summary get now time and format @Return (string) YYYY-MM-DD hh:ii:ss
func ToDateTime ¶ added in v1.1.0
ToDateTime 字符串转换到 Time DateTime
func ToTimeFormat ¶ added in v1.1.0
ToTimeFormat Returns 时间转换为字符串
func ToTimeFormatPoint ¶ added in v1.1.0
func ToTimestamp ¶ added in v1.1.0
ToTimestamp Returns 返回这个时间的毫秒数
func ToTimestampPoint ¶ added in v1.1.0
ToTimestampPoint Returns 返回这个时间的毫秒数
func VerifyAccountFormat ¶
VerifyAccountFormat doc @Summary Verify account is valid @Param (string) account @Return (bool) is valid
func VerifyCaptchaFormat ¶
VerifyCaptchaFormat doc @Summary Verify captcha is valid @Param (string) captcha @Return (bool) is valid
func VerifyEmailFormat ¶
VerifyEmailFormat doc @Summary Verify is email @Param (string) email @Return (bool) is valid
func VerifyMobileFormat ¶
VerifyMobileFormat doc @Summary Verify is mobile @Param (string) mobile @Return (bool) is valid
func VerifyPasswordFormat ¶
VerifyPasswordFormat doc @Summary Verify password is valid @Param (string) password @Return (bool) is valid
Types ¶
type Application ¶ added in v1.1.0
Application Daemon 服务对象接口
type Daemon ¶ added in v1.1.0
type Daemon struct {
// contains filtered or unexported fields
}
Daemon doc
type SensitiveMap ¶
type SensitiveMap struct {
// contains filtered or unexported fields
}
SensitiveMap filer/tire
type SignalWatch ¶
type SignalWatch struct {
// contains filtered or unexported fields
}
SignalWatch doc @Struct SignalWatch @Summary signal watch proccesser
func (*SignalWatch) Initial ¶
func (slf *SignalWatch) Initial(f func())
Initial doc @Method Initial @Summary Initialization signal watcher @Param (func()) Signal response back call function
func (*SignalWatch) Wait ¶
func (slf *SignalWatch) Wait()
Wait doc @Method Wait @Summary wait signal watcher exit
func (*SignalWatch) Watch ¶
func (slf *SignalWatch) Watch()
Watch doc @Method Watch @Summary start watch signal
type SnowFlake ¶
type SnowFlake struct {
// contains filtered or unexported fields
}
SnowFlake doc @Summary snowflake object @Struct SnowFlake @Member int64 last stamp @Member int64 worker id @Member int64 data center id @Member int64 sequence @Member Mutex
func NewSnowFlake ¶
NewSnowFlake doc @Summary new snowflake object @Method NewSnowFlake @Param int64 worker id @Param int64 id @Return *SnowFlake