Documentation
¶
Index ¶
- Constants
- func CamelString(s string) string
- func CheckEmail(email string) bool
- func CheckMobile(mobile string) bool
- func ContentSubtype(contentType string) string
- func ContentType(subtype string) string
- func DecimalRoundAdd(a, b float64) float64
- func GRPCCodeFromStatus(code int) codes.Code
- func GenIdStringAsDateFormat() string
- func GetClientIp(ctx context.Context) string
- func GetEndMonth(end time.Time) uint32
- func GetFirstDateOfWeek() time.Time
- func GetFirstOfMonth(now time.Time) time.Time
- func GetFirstOfMonthForStr(month string) time.Time
- func GetFirstOfQuarter(now time.Time) time.Time
- func GetFirstOfWeek(now time.Time) time.Time
- func GetLastOfMonth(now time.Time) time.Time
- func GetLastOfMonthForStr(month string) time.Time
- func GetLastWeekFirstDate() time.Time
- func GetMonthDiff(start, end time.Time) uint32
- func GetOfficeLimit(page, pageSize *uint32) (int, int)
- func JsonBytes(v interface{}) []byte
- func JsonString(v interface{}) string
- func MD5String(str string) string
- func NewCaptchaDriver() *captcha.DriverString
- func PBTimeString(timestamp *timestamppb.Timestamp) string
- func ParseLocalTime(layout string, value string) (time.Time, error)
- func RandomIntStr(n int) string
- func RandomString(n int) string
- func StatusFromGRPCCode(code codes.Code) int
- func SubMonth(t1, t2 time.Time) (month int)
- func Timestamppb(now *time.Time) *timestamppb.Timestamp
- func UnitJoin(elems []uint32, sep string) string
- func UnitSplit(s, sep string) []uint32
- func UnsafeStringToInt64(str string) int64
- func UnsafeStringToUInt32(str string) uint32
- func VerifyAccount(account string) bool
- func VerifyIsBankNo(no string) bool
- func VerifyIsCompany(name string) bool
- func VerifyIsIpaddress(ip string) bool
- func VerifyIsMail(mail string) bool
- func VerifyIsPasswd(passwd string) bool
- func VerifyIsPhoneNumber(phone string) bool
- func VerifyIsTaxID(taxID string) bool
- func VerifyIsZipCode(code string) bool
- type Query
- type StringTypeMap
Constants ¶
View Source
const ( // StatusClientClosed is non-standard http status code, // which defined by nginx. // https://httpstatus.in/499/ StatusClientClosed = 499 )
Variables ¶
This section is empty.
Functions ¶
func ContentSubtype ¶
ContentSubtype returns the content-subtype for the given content-type. The given content-type must be a valid content-type that starts with but no content-subtype will be returned. according rfc7231. contentType is assumed to be lowercase already.
func ContentType ¶
ContentType returns the content-type with base prefix.
func DecimalRoundAdd ¶
func GRPCCodeFromStatus ¶
GRPCCodeFromStatus converts a HTTP error code into the corresponding gRPC response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
func GenIdStringAsDateFormat ¶
func GenIdStringAsDateFormat() string
func GetClientIp ¶
func GetEndMonth ¶
func GetFirstOfMonthForStr ¶
func GetLastOfMonthForStr ¶
func GetMonthDiff ¶
func GetOfficeLimit ¶
func JsonString ¶
func JsonString(v interface{}) string
func NewCaptchaDriver ¶
func NewCaptchaDriver() *captcha.DriverString
func PBTimeString ¶
func PBTimeString(timestamp *timestamppb.Timestamp) string
func RandomIntStr ¶
func RandomString ¶
func StatusFromGRPCCode ¶
StatusFromGRPCCode converts a gRPC error code into the corresponding HTTP response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
func Timestamppb ¶
func Timestamppb(now *time.Time) *timestamppb.Timestamp
func UnsafeStringToInt64 ¶
func UnsafeStringToUInt32 ¶
func VerifyAccount ¶
func VerifyIsBankNo ¶
func VerifyIsCompany ¶
func VerifyIsIpaddress ¶
func VerifyIsMail ¶
func VerifyIsPasswd ¶
func VerifyIsPhoneNumber ¶
func VerifyIsTaxID ¶
func VerifyIsZipCode ¶
Types ¶
type StringTypeMap ¶
type StringTypeMap []string
func (StringTypeMap) CheckKey ¶
func (s StringTypeMap) CheckKey(v string) bool
Click to show internal directories.
Click to hide internal directories.