Documentation ¶
Index ¶
- Constants
- Variables
- func ArgsAny(args []interface{}, defs interface{}) interface{}
- func ArgsBool(args []bool, defs bool) bool
- func ArgsInt(args []int, defs int) int
- func ArgsIntN(args []int64, defs int64) int64
- func ArgsStr(args []string, defs string) string
- func ArrayFirst(arr []string, defaults ...string) string
- func BigNumberStringer(num int64) string
- func Boolean(str string) bool
- func CheckHours() bool
- func CompareTime(t1, t2 time.Time) bool
- func Decimal(f float64, n ...int) float64
- func DecimalText(f float64, n ...int) string
- func Decrypt(data string, key ...string) string
- func DesDecrypt(decrypted string, key []byte) (string, error)
- func DesEncrypt(text string, key []byte) (string, error)
- func Encrypt(data string, key ...string) string
- func FileHash(file string) string
- func FileSizeTans(size string, unit string) int64
- func FormatFileSize(fileSize int64) string
- func GetCdnUrl(url string, ty OssUrlType) string
- func GetConfigApp() *viper.Viper
- func GetDesKey(keys ...string) []byte
- func GetEnvBool(key string, def ...bool) bool
- func GetEnvFloat(key string, def ...float64) float64
- func GetEnvInt(key string, def ...int) int
- func GetEnvOr(key string, def ...string) string
- func GetFileType(file string) string
- func GetHourDiffer(startTime, endTime string) float32
- func GetId(db, collection string, sess *mgo.Session) int64
- func GetLastJsonErr() error
- func GetMP4Duration(reader io.ReaderAt) (lengthOfTime uint32, err error)
- func GetMp4FileDuration(fileName string) (time.Duration, error)
- func GetNextHourTime(s string, n int64) string
- func GetNormalTimeString(t time.Time) string
- func GetTime() time.Time
- func GetTimeByInt(t1 int64) time.Time
- func GetTimeByNormalString(timeStr string) (time.Time, error)
- func GetTimeByString(timeStr string) (time.Time, error)
- func GetTimeMills(t time.Time) int64
- func GetTimeString(t time.Time) string
- func GetTimeUnix(t time.Time) int64
- func HashCode(any interface{}) string
- func Import(source string, force ...bool) bool
- func InArray(value string, array []string, fold ...bool) bool
- func Integer(v interface{}) (int, bool)
- func IsCnMobile(mobile string) bool
- func IsEmail(email string) bool
- func IsExits(file string) bool
- func IsIocNotFound(v interface{}) bool
- func IsMobile(mobile string) bool
- func IsNumber(v interface{}) bool
- func Json() jsonApi.API
- func JsonDecode(data []byte, bindTo ...interface{}) interface{}
- func JsonDecodeBy(str string, bindTo ...interface{}) interface{}
- func JsonEncode(v interface{}) []byte
- func MapMerge(m ...beego.M) beego.M
- func MarkerMobile(mobile string) string
- func Md5(str string) string
- func Merge(m ...map[string]interface{}) map[string]interface{}
- func NewHashMapper(v ...interface{}) []interface{}
- func NewIntegerArray(v ...interface{}) []int
- func PasswordHash(pass string, salt ...string) string
- func PasswordVerify(encodePass string, pass string, salt ...string) bool
- func RandFloat64(min, max float64) float64
- func RandInt(min, max int) int
- func RandNumbers(len int) string
- func RandomAnyWord(count int) string
- func RandomNickName(lens ...int) string
- func RandomNumLimitN(count int) string
- func RandomWord(count int) string
- func RandomWords(count int, words string) string
- func RandomZhWords(count int) string
- func Shuffle(arr []interface{}) []interface{}
- func UniqueFile(file string, root ...string) string
- func VariableParse(varStr string, i ...int) string
- func ZeroPadding(cipherText []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type BoxHeader
- type CommitId
- type ContainerInterface
- type EnumBool
- type FileSize
- type OssUrlBuilder
- type OssUrlType
- type UrlLoader
Constants ¶
View Source
const ( DesEnvKeyName = "APP_ENCRYPT_DES_KEY" DesEncryptErrMsg = "need a multiple of the block size" DesDecryptErrMsg = "crypto/cipher: input not full blocks" )
View Source
const ( BigNumberK = 1000 BigNumberKUnit = "k" BigNumberW = BigNumberK * 10 BigNumberWUnit = "w" BigNumberKW = BigNumberW * BigNumberK BigNumberKWUnit = "kw" BigNumberWW = BigNumberKW * BigNumberK BigNumberWWUnit = "ww" )
View Source
const ( TIMEFORMAT = "20060102150405" NORMALTIMEFORMAT = "2006-01-02 15:04:05" )
View Source
const ( Mov = "moov" Mat = "mdat" )
View Source
const (
BigEndian = false
)
View Source
const (
PasswordAPPKey = "71e920133ebb7d0a94b9daed8f6c2d9a"
)
Variables ¶
View Source
var ( BigNumberMapper = []struct { Limiter int64 Unit string }{ {BigNumberK, BigNumberKUnit}, {BigNumberW, BigNumberWUnit}, {BigNumberKW, BigNumberKWUnit}, {BigNumberWW, BigNumberWWUnit}, } )
View Source
var (
ContainerNotFound = errors.New("not exists in container")
)
Functions ¶
func GetCdnUrl ¶
func GetCdnUrl(url string, ty OssUrlType) string
func GetEnvBool ¶
func GetEnvFloat ¶
func GetHourDiffer ¶
GetHourDiffer 计算俩个时间差多少小时
func GetMP4Duration ¶
GetMP4Duration 获取视频时长,以秒计
func GetMp4FileDuration ¶
GetMp4FileDuration 获取mp4 时长
func GetNormalTimeString ¶
GetNormalTimeString 格式化为:2006-01-02 15:04:05
func GetTimeByNormalString ¶
GetTimeByNormalString 标准字符串转时间
func GetTimeByString ¶
GetTimeByString 字符串转时间
func IsCnMobile ¶
func IsIocNotFound ¶
func IsIocNotFound(v interface{}) bool
func JsonDecode ¶
func JsonDecode(data []byte, bindTo ...interface{}) interface{}
JsonDecode json 解码
func JsonDecodeBy ¶
func JsonDecodeBy(str string, bindTo ...interface{}) interface{}
JsonDecodeBy 解码
func MarkerMobile ¶
func PasswordVerify ¶
PasswordVerify 密码验证
func RandFloat64 ¶
func RandNumbers ¶
func RandomAnyWord ¶
func RandomNickName ¶
func RandomNumLimitN ¶
func RandomWord ¶
func RandomWords ¶
func RandomZhWords ¶
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type CommitId ¶
type ContainerInterface ¶
type ContainerInterface interface { Exists(id string) bool Reset(name ...string) ContainerInterface Get(id string, args ...interface{}) interface{} Register(name string, factory func(args ...interface{}) interface{}, force ...bool) ContainerInterface GetInstance(name string, args ...interface{}) interface{} }
func Container ¶
func Container() ContainerInterface
type OssUrlBuilder ¶
type OssUrlBuilder interface { GetUrl(ty ...OssUrlType) string SetSourceUrl(string) OssUrlBuilder }
func OssUrl ¶
func OssUrl(url string) OssUrlBuilder
type OssUrlType ¶
type OssUrlType string
const ( Row OssUrlType = "row" Media OssUrlType = "medium" Big OssUrlType = "big" Small OssUrlType = "small" DefOptFlag = "@" // 类型参数符号 OptFlagEnvKey = "QINNIU_URL_OPT_FLAG" )
Click to show internal directories.
Click to hide internal directories.