Documentation
¶
Overview ¶
*
- @author Liu Yongshuai<liuyongshuai@hotmail.com>
- @date 2018-03-27 15:20
Index ¶
- Variables
- func ArrayToString(array []interface{}) string
- func AuthKeyFromBytes(key []byte) (*ecdsa.PrivateKey, error)
- func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, ...) (error, string)
- func ByteToFloat64(bytes []byte) float64
- func ByteToStr(b []byte) string
- func Bytes2str(b []byte) string
- func BytesToInt64(buf []byte) int64
- func CheckAppleID(data []byte, id string, err error) bool
- func CheckFileIsExist(path string) bool
- func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool)
- func CreateUUID() (uuid string)
- func DecryptDES(src []byte) []byte
- func EncryptDES(src []byte) []byte
- func Eq(mark string) string
- func FakeTraceId() (traceId string)
- func FilterIds(ids []interface{}) (ret []int64)
- func Float64ToByte(float float64) []byte
- func Ge(mark string) string
- func GetAppleLoginData(clientId string, clientSecret string, code string) ([]byte, error)
- func GetAppleSecret(keyId string, teamId string, clientId string, keySecret string) string
- func GetMessageIndex(sendFrom, sendTo string) (msgIndex string)
- func GetPageParam(page, size int32) (int32, int32)
- func Gt(mark string) string
- func InSlice(val interface{}, sl []interface{}) bool
- func Int64ToBytes(i int64) []byte
- func Int64ToString(intNum int64) (result string)
- func IntToString(intNum int) (result string)
- func Le(mark string) string
- func Lt(mark string) string
- func MD5V(str []byte) string
- func MakeFile(fileName string, FileMd5 string) (error, string)
- func MakeMyRespError(code int32, msg string) error
- func MaxInt64(args ...interface{}) (int64, error)
- func MinInt64(args ...interface{}) (int64, error)
- func Ne(mark string) string
- func NotEmpty() string
- func Paginator(page, pageSize int, nums int64, list interface{}) map[string]interface{}
- func ParseMyRespError(errStr string) (code int32, msg string)
- func PathExists(path string) (bool, error)
- func ProcTime(st, et int64) float64
- func RandFloat64InRange(min, max float64) float64
- func ReRandSeed()
- func RegisterRule(key string, rule Rules) (err error)
- func RemoveChunk(FileMd5 string) error
- func SliceChunk(slice []interface{}, size int) (chunkSlice [][]interface{})
- func SliceDiff(slice1, slice2 []interface{}) (diffSlice []interface{})
- func SliceFilter(slice []interface{}, a filterCallbackFunc) (filteredSlice []interface{})
- func SliceIntersect(slice1, slice2 []interface{}) (intersectSlice []interface{})
- func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
- func SlicePad(slice []interface{}, size int, val interface{}) []interface{}
- func SliceRand(a []interface{}) (b interface{})
- func SliceReduce(slice []interface{}, a reduceCallbackFunc) (dSlice []interface{})
- func SliceShuffle(slice []interface{}) []interface{}
- func SliceSum(slice []interface{}) (sum int64)
- func SliceUnique(slice []interface{}) (uniqueSlice []interface{})
- func Str2JsonStr(oStr string) map[string]interface{}
- func Str2bytes(s string) []byte
- func StrToByte(s string) []byte
- func StringToInt(parseString string) (result int, err error)
- func StringToInt64(parseString string) (result int64, err error)
- func StructToMap(obj interface{}) (data map[string]interface{}, err error)
- func ToFloat64Slice(arg []interface{}, ignoreErr bool) (ret []float64, err error)
- func ToInt64Slice(arg []interface{}, ignoreErr bool) (ret []int64, err error)
- func ToSliceIface(in interface{}) []interface{}
- func ToStringSlice(arg []interface{}, ignoreErr bool) (ret []string, err error)
- func TryBestToBool(value interface{}) (bool, error)
- func TryBestToFloat(value interface{}) (float64, error)
- func TryBestToInt64(value interface{}) (int64, error)
- func TryBestToString(value interface{}) (string, error)
- func TryBestToUint64(value interface{}) (uint64, error)
- func Verify(st interface{}, roleMap Rules) (err error)
- func ZipFiles(filename string, files []string, oldform, newform string) error
- type AppleAuth
- type AppleIdToken
- type Basickind
- type CommonResponse
- type Page
- type Rules
- type RulesMap
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocalHostIP = "" LocalHostIpArr []string LocalHostIpTraceId = "" ScreenWidth int ScreenHeight int )
View Source
var ( //一些错误信息 ErrorOverflowMaxInt64 = errors.New("this value overflow math.MaxInt64") ErrorOverflowMaxUint64 = errors.New("this value overflow math.MaxUint64") ErrorLessThanMinInt64 = errors.New("this value less than math.MinInt64") ErrorLessThanZero = errors.New("this value less than zero") ErrorBadComparisonType = errors.New("invalid type for comparison") ErrorBadComparison = errors.New("incompatible types for comparison") ErrorNoComparison = errors.New("missing argument for comparison") ErrorInvalidInputType = errors.New("invalid input type") )
View Source
var CustomizeMap = make(map[string]Rules)
Functions ¶
func ArrayToString ¶
func ArrayToString(array []interface{}) string
func BreakPointContinue ¶
func CheckAppleID ¶
解密苹果返回的data中的id_token中的用户id和客户端post的id否一致
func CheckFileIsExist ¶
func DecryptDES ¶
func EncryptDES ¶
func GetAppleLoginData ¶
请求苹果用户信息
func GetAppleSecret ¶
生成client_secret
func GetMessageIndex ¶
func GetPageParam ¶
func Int64ToString ¶
func IntToString ¶
func MakeMyRespError ¶
func ParseMyRespError ¶
func PathExists ¶
func RemoveChunk ¶
func SliceChunk ¶
func SliceChunk(slice []interface{}, size int) (chunkSlice [][]interface{})
将一个slice切成若干个大小的子slice
func SliceDiff ¶
func SliceDiff(slice1, slice2 []interface{}) (diffSlice []interface{})
计算两个slice的差集
func SliceFilter ¶
func SliceFilter(slice []interface{}, a filterCallbackFunc) (filteredSlice []interface{})
返回给定的slice在回调函数返回true的新slice
func SliceIntersect ¶
func SliceIntersect(slice1, slice2 []interface{}) (intersectSlice []interface{})
计算slice交集
func SliceReduce ¶
func SliceReduce(slice []interface{}, a reduceCallbackFunc) (dSlice []interface{})
对给定的slice调用回调函数,生成一个新的slice
func Str2JsonStr ¶
func StringToInt ¶
func StringToInt64 ¶
func StructToMap ¶
利用反射将结构体转化为map
func ToFloat64Slice ¶
转为float64地slice
func ToInt64Slice ¶
转为int64地slice
func ToSliceIface ¶
func ToSliceIface(in interface{}) []interface{}
将其他类型转为interface的切片,支持slice/map/[u]int[8-64]/float../string
func ToStringSlice ¶
转为字符串slice
func TryBestToInt64 ¶
尽最大努力将给定的类型转换为int64 如"45.67"->45、"98.4abc3"->98、"34.87"->34
func TryBestToUint64 ¶
尽最大努力将给定的类型转换为uint64 如"45.67"->45、"98.4abc3"->98、"34.87"->34
Types ¶
type AppleIdToken ¶
type AppleIdToken struct { Iss string `json:"iss,omitempty"` Aud string `json:"aud,omitempty"` Exp int `json:"exp,omitempty"` Iat int `json:"iat,omitempty"` Sub string `json:"sub,omitempty"` AtHash string `json:"at_hash,omitempty"` Email string `json:"email,omitempty"` EmailVerified string `json:"email_verified,omitempty"` IsPrivateEmail string `json:"is_private_email,omitempty"` AuthTime int `json:"auth_time,omitempty"` NonceSupported bool `json:"nonce_supported,omitempty"` }
type CommonResponse ¶
type CommonResponse struct { Code int32 `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
func NewCommonResponse ¶
func NewCommonResponse() *CommonResponse
Source Files
¶
Click to show internal directories.
Click to hide internal directories.