Documentation ¶
Index ¶
- Variables
- func AbsInt64(d int64) int64
- func AddInt64Set(array []int64, d int64) []int64
- func AddIntSet(array []int, d int) []int
- func BoolToInt(b bool) int
- func ChoiceInt64(src []int64) int64
- func ChoiceInts(src []int) int
- func CleanPath(path string) string
- func CmpAndroidVersion(v1, v2 string) int
- func CmpAppleVersion(v1, v2 string) int
- func CmpInt64s(a, b []int64) int
- func Day(t time.Time) string
- func DayDiff(a, b int) int
- func Double2dp(n float64) float64
- func FileExists(path string) bool
- func FileMd5String(f io.Reader) string
- func Float2dp(n float32) float32
- func FormatCityCode(code string) string
- func FormatDate(time time.Time, style string) string
- func FormatLanguage(s string) string
- func FromDate(date string) (int, error)
- func FromUnixTime(timestamp int) string
- func GenerateNonce(size int) []byte
- func GenerateStringNonce(size int) string
- func GetAge(fromDate string) (int, error)
- func GetConstellation(date string) int
- func GetConstellationMD(month, day int) int
- func GetDayStart(d time.Time) time.Time
- func GetHourStart(t time.Time) time.Time
- func GetMonthEnd(d time.Time) time.Time
- func GetMonthRange(now time.Time) (int, int)
- func GetMonthStart(d time.Time) time.Time
- func GetWeekEnd(t time.Time) time.Time
- func GetWeekStart(t time.Time) time.Time
- func HourIn(fromHour int, endHour int) bool
- func InInt32s(src int32, array []int32) bool
- func InInt64s(src int64, array []int64) bool
- func InInts(src int, array []int) bool
- func InStrings(src string, array []string) bool
- func Int32sToInts(src []int32) []int
- func Int64sRemove(array []int64, d int64) []int64
- func Int64sToSet(a []int64) map[int64]struct{}
- func IntsRemove(array []int, d int) []int
- func IntsToInt32s(src []int) []int32
- func IsAlnum(s string) bool
- func IsDigit(s string) bool
- func IsInSameHour(t1 time.Time, t2 time.Time) bool
- func IsInSameWeek(t1 time.Time, t2 time.Time) bool
- func IsZh(lang string) bool
- func JoinInt64s(il []int64) string
- func JoinInts(il []int) string
- func JoinStrings(sl []string) string
- func JsonDecode(data []byte, v interface{}) error
- func JsonEncode(v interface{}) ([]byte, error)
- func JsonString(v interface{}) string
- func Md5String(data []byte) string
- func Monday(t time.Time) string
- func Month(t time.Time) string
- func MustJsonDecode(data []byte, v interface{})
- func MustJsonEncode(v interface{}) []byte
- func NormalizePhoneNumber(number string) (string, error)
- func PhoneToCC(phone_number string) string
- func Raise(err error)
- func RandDigitCode(l int) string
- func SampleInt64(src []int64, n int) []int64
- func Sha1Digest(data []byte) []byte
- func Sha1String(data []byte) string
- func ShuffleInt64(a []int64)
- func SubtractInt64s(a, b []int64) []int64
- func ToDate(timestamp int) string
- func ToE164(phone_number string) string
- func ToIntYMD(time time.Time) int
- func ToInts(s string) []int
- func ToJson(v interface{}) string
- func ToYMD(timestamp int) string
- func ToYMDHIS(timestamp int) string
- func Today() int
- func TrimPhoneCC(phone_number string, ccs ...string) string
- func TruncateString(s string, n int) string
- func ValidPhoneNumber(s string) bool
- func VerifyAdCode(code string) bool
- type AndroidVersion
- type AppleVersion
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidPhoneNumber = fmt.Errorf("invalid phone number")
View Source
var RELEASE = os.Getenv("RELEASE") == "1"
if production enviroment
View Source
var VALID_ADCODE_PATTERN = regexp.MustCompile("^[0-9]{6,8}$")
Functions ¶
func AddInt64Set ¶
func ChoiceInts ¶
func FileExists ¶
func FileMd5String ¶
func GenerateNonce ¶
func GetConstellationMD ¶
func Int32sToInts ¶
func Int64sRemove ¶
func IntsRemove ¶
func IntsToInt32s ¶
func JoinInt64s ¶
func JoinStrings ¶
func JsonDecode ¶
func JsonEncode ¶
json.Marshal和json.Unmarshal处理int64有bug
func JsonString ¶
func JsonString(v interface{}) string
func MustJsonDecode ¶
func MustJsonDecode(data []byte, v interface{})
func MustJsonEncode ¶
func MustJsonEncode(v interface{}) []byte
func RandDigitCode ¶
func Sha1Digest ¶
func Sha1String ¶
func ShuffleInt64 ¶
func ShuffleInt64(a []int64)
func ValidPhoneNumber ¶
Types ¶
type AndroidVersion ¶
1.0.0
func ParseAndroidVersion ¶
func ParseAndroidVersion(v string) *AndroidVersion
type AppleVersion ¶
1.0.0-35
func ParseAppleVersion ¶
func ParseAppleVersion(v string) *AppleVersion
Click to show internal directories.
Click to hide internal directories.