Versions in this module Expand all Collapse all v1 v1.0.3 Oct 11, 2024 Changes in this version + const UA_DEVICE_MOBILE + const UA_DEVICE_MOBILE_ANDROID + const UA_DEVICE_MOBILE_IPHONE + const UA_DEVICE_MOBILE_WINDOWS + const UA_DEVICE_PC + const UA_DEVICE_TABLE + const UA_DEVICE_TABLE_ANDROID_PAD + const UA_DEVICE_TABLE_IPAD + const UA_DEVICE_TABLE_IPOD + const UA_OS_LINUX + const UA_OS_MAC + const UA_OS_WINDOWS + const UA_UNKNOW + func AddDaysForCurrent(days int) time.Time + func AddHoursForCurrent(hours int) time.Time + func AddMinutesForCurrent(minutes int) time.Time + func AesDecrypt(crypted, key []byte, args ...[]byte) ([]byte, error) + func AesEncrypt(origData, key []byte, args ...[]byte) ([]byte, error) + func Br2String(source string) string + func Command(cmd string, args ...string) (string, error) + func CreateCurrentDateDir(rootPath string, perm os.FileMode) (string, error) + func CreateDateDir(rootPath string, datetime time.Time, perm os.FileMode) (string, error) + func CreateDir(perm os.FileMode, args ...string) (string, error) + func CurrentTimeToString(args ...interface{}) string + func CutVideoImage(sourceFile, newFilename string, width, height uint64, second, q int) (string, error) + func DateToIntSlice(date time.Time) []int + func DateToStringSlice(date time.Time) []string + func DateToUnixNanoTimestamp(date time.Time) int64 + func DateToUnixTimestamp(date time.Time) int64 + func DatetimeAdd(firstDatetime time.Time, duration time.Duration) time.Time + func DatetimeAddDay(firstDatetime time.Time, dayValue int) time.Time + func DatetimeAddHour(firstDatetime time.Time, hourValue int) time.Time + func DatetimeAddMinute(firstDatetime time.Time, minuteValue int) time.Time + func DatetimeAddSecond(firstDatetime time.Time, secondValue int) time.Time + func DatetimeSub(firstDatetime, secondDatetime time.Time) time.Duration + func DeleteFile(filename string, args ...string) error + func DesDecrypt(crypted, key []byte) ([]byte, error) + func DesEncrypt(origData, key []byte) ([]byte, error) + func EmailFilter(source string) string + func FileIsExists(filename string) bool + func FilterHostProtocol(path string) string + func FilterInt64Slice(all, other []int64) []int64 + func FilterStringSlice(all, other []string) []string + func FilterUint64Slice(all, other []uint64) []uint64 + func FindPid(processName string) (int, error) + func Float64ToString(value float64) string + func Fnv32Hash(content string) uint32 + func Fnv64Hash(content string) uint64 + func FromBase64(data string, args ...bool) (string, error) + func FromJson(jsonString string, object interface{}) error + func FromXml(xmlString string, object interface{}) error + func GenRsaKey(bits int) (string, string, error) + func GetAbsolutePath(filePath string) string + func GetCurrentDay() int32 + func GetCurrentDayCount(args ...time.Time) int + func GetCurrentHour() int32 + func GetCurrentMinute() int32 + func GetCurrentMonth() int32 + func GetCurrentMonthMaxDate(args ...time.Time) time.Time + func GetCurrentMonthMaxNanoTimestamp(args ...time.Time) int64 + func GetCurrentMonthMaxTimestamp(args ...time.Time) int64 + func GetCurrentMonthMinDate(args ...time.Time) time.Time + func GetCurrentMonthMinNanoTimestamp(args ...time.Time) int64 + func GetCurrentMonthMinTimestamp(args ...time.Time) int64 + func GetCurrentPath() string + func GetCurrentSecond() int32 + func GetCurrentWeek() int + func GetCurrentWeekDayRange() (int, int) + func GetCurrentYear() int32 + func GetDateDay(datetime time.Time) int32 + func GetDateHour(datetime time.Time) int32 + func GetDateMinute(datetime time.Time) int32 + func GetDateMonth(datetime time.Time) int32 + func GetDateRangeForWeekInDateRange(startDate, endDate time.Time, week int) []time.Time + func GetDateSecond(datetime time.Time) int32 + func GetDateYear(datetime time.Time) int32 + func GetDateYearMonthDay(args ...time.Time) int + func GetDatetimeForDateAndTimeString(date time.Time, timeString string) time.Time + func GetDatetimeWeekString(datetime time.Time) string + func GetDayCount(datetime time.Time) int + func GetFileContent(fullFilename string) ([]byte, error) + func GetFilePath(filePath string) (string, string) + func GetFilename(filePath string) (string, string, string) + func GetImageFile(filename string, args ...string) (image.Image, error) + func GetMaxDate(dtTime time.Time) time.Time + func GetMaxDateNanoTimestamp(dtTime time.Time) int64 + func GetMaxDateTimestamp(dtTime time.Time) int64 + func GetMinDate(dtTime time.Time) time.Time + func GetMinDateNanoTimestamp(dtTime time.Time) int64 + func GetMinDateTimestamp(dtTime time.Time) int64 + func GetNow() time.Time + func GetRelativePath(fullpath string) string + func GetSeqNumber() string + func GetStringCount(sourceString string) int + func GetStructFieldValueByName(target interface{}, fieldName string) (string, interface{}, error) + func GetSubString(sourceString string, count int, args ...string) string + func GetTimeIntervalStringSlice(startDate, endDate time.Time, minutes int64) []string + func GetTokenString() string + func GetUint64SliceRange(int64Slice []uint64, count int) []uint64 + func GetUrlParam(sourceUrl, paramName string) string + func GetUtcNow() time.Time + func GetWeek(datetime time.Time) int + func Guid() string + func HasPrefix(content, target string) bool + func HasPrefixSuffix(content, target string) bool + func HasSuffix(content, target string) bool + func Hash(content string) uint64 + func HmacSha1(data string, key string, args ...bool) string + func HmacSha256(data string, key string, args ...bool) string + func HtmlAudioFilter(source string) string + func HtmlCssFilter(source string) string + func HtmlDecode(source string, args ...bool) string + func HtmlEncode(source string, args ...bool) string + func HtmlHyperLinkFilter(source string) string + func HtmlImageFilter(source string) string + func HtmlScriptFilter(source string) string + func HtmlTagFilter(source string) string + func HtmlVideoFilter(source string) string + func HttpGet(url string, args ...string) (string, error) + func HttpPost(url, params string, args ...string) (string, error) + func HttpPostFile(url, filename, fileTag string, params map[string]string) (int, map[string][]string, string, error) + func IdCardNumFilter(source string) string + func Int64Diff(one, two []int64) []int64 + func Int64Inter(one, two []int64) []int64 + func Int64SliceToString(intSlice []int64, args ...string) string + func Int64SliceToStringSlice(values []int64) []string + func Int64ToString(value int64) string + func Int64Union(one, two []int64) []int64 + func IntSliceToDate(intSlice []int) (time.Time, error) + func IsAlpha(sourceString string, args ...interface{}) bool + func IsAlphaOrNumber(sourceString string) bool + func IsChinese(sourceString string, args ...interface{}) bool + func IsDateGreaterThan(firstDatetime, secondDatetime time.Time) bool + func IsDateLessThan(firstDatetime, secondDatetime time.Time) bool + func IsEmail(sourceString string, args ...interface{}) bool + func IsIdCardNum(sourceString string) bool + func IsLocalIp(ip string) (bool, error) + func IsMatchStringSliceCount(srcSlice []string, maxCount, stringItemCount int) bool + func IsMobile(sourceString string) bool + func IsNumber(sourceString string, args ...interface{}) bool + func IsRegexpMatch(sourceString string, pattern string) bool + func IsSql(source string) bool + func IsTelphone(sourceString string) bool + func IsUsername(sourceString string, args ...interface{}) bool + func JoinMapToString(params map[string]string, filterKeys []string, isEscape bool) string + func Map64Hash(content string) uint64 + func MapDataSign(params map[string]string, secret string) (string, bool) + func MarkdownImageFilter(source string) string + func Md5(data string) string + func MinutesToTimeString(minutes int64) string + func MobileFilter(source string) string + func ModFloat64(value float64, length int) float64 + func MonthsToSeasons(months []int32) []string + func MoveFile(srcFilename, dstPath string, creationDate time.Time) (string, error) + func NewStringTable(args ...int) *stringTable + func NewkeywordNode() *keywordNode + func NumberToStringTable(id int64) string + func Pkcs5Padding(ciphertext []byte, blockSize int) []byte + func Pkcs5UnPadding(origData []byte) []byte + func QueryEncode(value string) string + func RSADecrypt(cipherData, privateKey []byte) ([]byte, error) + func RSAEncrypt(origData, publicKey []byte) ([]byte, error) + func RandInt(maxInt int) int + func RandIntRange(min, max int) int + func RandNumberString(length int) string + func RandString(length int) string + func ReverseString(sourceString string) string + func ReverseUint64Slice(int64Slice []uint64) + func RsaPrivateToMultipleLine(privateKey string) string + func RsaPublicToMultipleLine(privateKey string) string + func SafeParam(source string) string + func SafeString(source string) string + func Salt() string + func SaveFile(data []byte, filename, basePath string, args ...string) (string, error) + func Sha1(data string) string + func Sha256(data string) string + func Sha256WithRsa(data string, privateKey string) (string, error) + func Sha256WithRsaVerify(data, sign, publicKey string) (bool, error) + func Shuffle(arr []int, args ...int) + func SplitIpPort(ip string) (string, int) + func SqlFilter(source string) string + func StartProcess(processName string) (string, error) + func StopProcess(processName string) (string, error) + func String2Br(source string) string + func StringDiff(one, two []string) []string + func StringInter(one, two []string) []string + func StringReplace(sourceString string, args ...string) string + func StringSliceLatest(srcSlice []string, maxCount int) []string + func StringSliceToDate(dateStringSlice []string) (time.Time, error) + func StringSliceToInt64Slice(values []string) []int64 + func StringSliceToString(stringSlice []string, args ...string) string + func StringSliceToUint64Slice(values []string) []uint64 + func StringTableToNumber(sourceString string) int64 + func StringToBool(stringValue string) bool + func StringToFloat64(stringValue string) float64 + func StringToInt32(stringValue string) int32 + func StringToInt64(stringValue string) int64 + func StringToInt64Slice(sourceString string, args ...string) []int64 + func StringToIntSlice(sourceString string, args ...string) []int + func StringToStringSlice(sourceString string, args ...string) []string + func StringToTime(datetimeString string, args ...interface{}) (time.Time, error) + func StringToUint32(stringValue string) uint32 + func StringToUint64(stringValue string) uint64 + func StringToUint64Slice(sourceString string, args ...string) []uint64 + func StringUnion(one, two []string) []string + func TimeStringAddMinutes(timeString string, minutes int) string + func TimeToFriendString(datetime time.Time, args ...interface{}) string + func TimeToString(datetime time.Time, args ...interface{}) string + func ToBase64(data string, args ...bool) string + func ToJson(object interface{}) (string, error) + func ToQueryString(values map[string]interface{}, args ...bool) string + func ToXml(object interface{}) (string, error) + func TrimSpaceLine(source string) string + func Try(fnSource func(), fnError func(interface{})) (er error) + func Uint64Diff(one, two []uint64) []uint64 + func Uint64Inter(one, two []uint64) []uint64 + func Uint64SliceToString(uintSlice []uint64, args ...string) string + func Uint64SliceToStringSlice(values []uint64) []string + func Uint64ToString(value uint64) string + func Uint64Union(one, two []uint64) []uint64 + func UnixDate() time.Time + func UnixNanoTimestamp() int64 + func UnixNanoTimestampToDate(unixNanoTimestamp int64) time.Time + func UnixTimestamp() int64 + func UnixTimestampDate() time.Time + func UnixTimestampToDate(unixTimestamp int64) time.Time + func UrlDecode(sourceUrl string) string + func UrlEncode(sourceUrl string) string + type FieldInfo struct + Childs []*FieldInfo + Index []int + Interface interface{} + Kind string + Name string + Tag reflect.StructTag + Type string + Value reflect.Value + type FileInfo struct + Data []byte + Duration int64 + Filename string + Path string + Size int64 + func GetHttpRequestFile(req *http.Request, args ...int32) (*FileInfo, error) + func SaveHttpFile(req *http.Request, filename, basePath string, maxSize int32, args ...string) (*FileInfo, error) + type FileInfoList []*FileInfo + type IFileSize interface + Size func() int64 + type Keyword struct + Root *keywordNode + func NewKeyword() *Keyword + func (s *Keyword) AddKeyword(keyword string) + func (s *Keyword) AddKeywords(keywords ...string) + func (s *Keyword) Filter(content string, args ...string) string + type MethodInfo struct + In []string + Index int + Name string + NumIn int + NumOut int + Out []string + Value reflect.Value + type Paging struct + Group string + IsTotalOnce bool + PagingCount int64 + PagingIndex int64 + PagingSize int64 + Sortorder string + TotalRecord int64 + func NewPaging() *Paging + func (paging *Paging) EndIndex() int64 + func (paging *Paging) Offset() int64 + func (paging *Paging) SetTotalRecord(totalRecord int64) + type Reflect struct + func NewReflect(target interface{}) *Reflect + func (s *Reflect) Dump() string + func (s *Reflect) Field(index int) (fieldValue reflect.Value, er error) + func (s *Reflect) FieldByIndex(indexs []int) (fieldValue reflect.Value, er error) + func (s *Reflect) FieldByName(name string) (reflect.Value, error) + func (s *Reflect) FieldInfo(index int) (fieldInfo *FieldInfo, er error) + func (s *Reflect) FieldInfoByIndex(indexs []int) (fieldInfo *FieldInfo, er error) + func (s *Reflect) FieldInfoByName(name string) (*FieldInfo, error) + func (s *Reflect) Fields() ([]*FieldInfo, error) + func (s *Reflect) Interface() interface{} + func (s *Reflect) Invoke(methodName string, args ...interface{}) ([]reflect.Value, error) + func (s *Reflect) IsArray() bool + func (s *Reflect) IsAssignableTo(inter interface{}) bool + func (s *Reflect) IsComparable() bool + func (s *Reflect) IsConvertibleTo(inter interface{}) bool + func (s *Reflect) IsFunc() bool + func (s *Reflect) IsImplements(inter interface{}) bool + func (s *Reflect) IsMap() bool + func (s *Reflect) IsPtr() bool + func (s *Reflect) IsSlice() bool + func (s *Reflect) IsStruct() bool + func (s *Reflect) Kind() reflect.Kind + func (s *Reflect) Len() int + func (s *Reflect) Method(index int) (reflect.Value, error) + func (s *Reflect) MethodByName(name string) (reflect.Value, error) + func (s *Reflect) MethodInfoByName(name string) (*MethodInfo, error) + func (s *Reflect) Methods() []*MethodInfo + func (s *Reflect) NumField() int + func (s *Reflect) NumMethod() int + func (s *Reflect) SetField(name string, value interface{}) error + func (s *Reflect) Size() uintptr + func (s *Reflect) Tag(index int) reflect.StructTag + func (s *Reflect) Type() reflect.Type + func (s *Reflect) Value() reflect.Value + type ReflectFunc struct + func NewReflectFunc() *ReflectFunc + func (s *ReflectFunc) Call(key string, args ...interface{}) ([]reflect.Value, error) + func (s *ReflectFunc) Register(key string, fn interface{}) error + type UserAgent struct + func NewUserAgent(content string) *UserAgent + func (s *UserAgent) GetContent() string + func (s *UserAgent) GetDevice() UserAgentDevice + func (s *UserAgent) GetOs() UserAgentOs + func (s *UserAgent) IsAndroid() bool + func (s *UserAgent) IsAndroidPad() bool + func (s *UserAgent) IsBlackBerry() bool + func (s *UserAgent) IsChromeBrowser() bool + func (s *UserAgent) IsFirfoxBrowser() bool + func (s *UserAgent) IsIeBrowser() bool + func (s *UserAgent) IsIpad() bool + func (s *UserAgent) IsIphone() bool + func (s *UserAgent) IsIpod() bool + func (s *UserAgent) IsMobile() bool + func (s *UserAgent) IsOperaBrowser() bool + func (s *UserAgent) IsPc() bool + func (s *UserAgent) IsSafariBrowser() bool + func (s *UserAgent) IsTable() bool + func (s *UserAgent) IsWindowsPhone() bool + type UserAgentDevice struct + func (s UserAgentDevice) GetChildName() string + func (s UserAgentDevice) GetContent() string + func (s UserAgentDevice) GetName() string + type UserAgentOs struct + func (s UserAgentOs) GetContent() string + func (s UserAgentOs) GetName() string