Versions in this module Expand all Collapse all v0 v0.0.2 Jul 20, 2022 Changes in this version + const Characters + const CharactersCN + const CharactersLowercase + const CharactersUppercase + const Numbers + const NumbersDecimal + const NumbersWritten + const TimeLayoutCnLong + const TimeLayoutCnShort + const TimeLayoutDateCnLong + const TimeLayoutDateCnShort + const TimeLayoutDateDefault + const TimeLayoutDateSimple + const TimeLayoutDefault + const TimeLayoutSimple + func AESDecrypt(encryptedData, key []byte) ([]byte, error) + func AESEncrypt(originalData, key []byte) ([]byte, error) + func AbsInt(a, b int) int + func AbsInt32(a, b int32) int32 + func AbsInt64(a, b int64) int64 + func Base64RandDecode(src string) string + func Base64RandEncode(src string) string + func BroadcastEvent(event string, data interface{}) + func CalcFileMD5(path string) string + func CalcLimit(pageSize, pageIndex int) int + func CalcPageCount(pageSize int, totalCount int64) int64 + func CalcStart(pageSize, pageIndex int) int + func CalcTextSimilarity(first, second string) float64 + func CalcTextSimilarityNoReplace(first, second string) float64 + func CheckIPAddressInRange(start, end, target string) bool + func ClockToSecond(clock string) int64 + func CompareClock(a time.Time, b time.Time) int + func CompareDate(a time.Time, b time.Time) int + func CopyFile(dst string, src string) error + func CopyStringSlice(src []string) []string + func DecodeObfuscatedString(s string) string + func DeepCopy(dst interface{}, src interface{}) error + func ExtractChars(s string, extractableChars ...string) string + func FillBoolSlice(src []bool, val bool) + func FillStringSlice(src []string, val string) + func FilterChars(s string, filterableChars ...string) string + func FormatDate(t time.Time) string + func FormatDateCNLong(t time.Time) string + func FormatDateCNShort(t time.Time) string + func FormatTime(t time.Time) string + func FormatTimeCNLong(t time.Time) string + func FormatTimeCNShort(t time.Time) string + func HttpGetWithFormBodyForData(url string, headerFields map[string]string, formFields map[string]string) ([]byte, error) + func HttpGetWithFormBodyForFile(url string, headerFields map[string]string, formFields map[string]string, ...) error + func HttpGetWithFormBodyForObject(url string, headerFields map[string]string, formFields map[string]string, ...) error + func HttpGetWithFormBodyForText(url string, headerFields map[string]string, formFields map[string]string) (string, error) + func HttpGetWithJsonBodyForData(url string, headerFields map[string]string, req interface{}) ([]byte, error) + func HttpGetWithJsonBodyForFile(url string, headerFields map[string]string, formFields map[string]string, ...) error + func HttpGetWithJsonBodyForObject(url string, headerFields map[string]string, req interface{}, res interface{}) error + func HttpGetWithJsonBodyForText(url string, headerFields map[string]string, req interface{}) (string, error) + func HttpPostWithFormBodyForData(url string, headerFields map[string]string, formFields map[string]string) ([]byte, error) + func HttpPostWithFormBodyForFile(url string, headerFields map[string]string, formFields map[string]string, ...) error + func HttpPostWithFormBodyForObject(url string, headerFields map[string]string, formFields map[string]string, ...) error + func HttpPostWithFormBodyForText(url string, headerFields map[string]string, formFields map[string]string) (string, error) + func HttpPostWithJsonBodyForData(url string, headerFields map[string]string, req interface{}) ([]byte, error) + func HttpPostWithJsonBodyForFile(url string, headerFields map[string]string, formFields map[string]string, ...) error + func HttpPostWithJsonBodyForObject(url string, headerFields map[string]string, req interface{}, res interface{}) error + func HttpPostWithJsonBodyForText(url string, headerFields map[string]string, req interface{}) (string, error) + func Init() + func Int64ArrayContains(array []int64, value int64) bool + func IntArrayContains(array []int, value int) bool + func IsDirExists(dirPath string) bool + func IsFileExists(filePath string) bool + func MakeUrl(proto string, ip string, port int, parts ...string) string + func NewBoolSlice(len int, def bool) []bool + func NewStringSlice(len int, def string) []string + func Now() time.Time + func NowDate() time.Time + func NowDateInMillis() int64 + func NowDateInSeconds() int64 + func NowDateInSimpleString() string + func NowDateInString() string + func NowInClockSpan(beginClock string, endClock string) bool + func NowInMillis() int64 + func NowInNanos() int64 + func NowInSeconds() int64 + func NowInSimpleString() string + func NowInString() string + func ObfuscateString(s string) string + func ParseDate(date string) (time.Time, error) + func ParseTime(s string) (time.Time, error) + func RandomString(length int) string + func RegisterEventReceiver(receiver func(event string, data interface{})) + func RemoveAtStringSlice(src []string, at int) []string + func ReplaceSimilarText(s string) string + func ScheduleTask(firstExecTimeInSeconds int64, execFunc func() int64) + func ShuffleRuneArray(input []rune) + func SplitWithoutEmpty(s, sep string) []string + func StringArrayContains(array []string, value string) bool + func StringArrayContainsAny(array []string, values []string) bool + func StringArrayRemoveDuplicated(array []string) []string + func StringContainsAll(s string, chars string) bool + func SubList(array interface{}, pageSize, pageIndex int) interface + func ToJsonString(v interface{}) string + func TryClose(closer io.Closer) + func TryDivide(a int64, b int64) float64 + func TryDivideToPercent(a int64, b int64) float64 + func TryParseBool(s string, def bool) bool + func TryParseBoolSlice(ss []string, def bool) []bool + func TryParseFloat32(s string, def float32) float32 + func TryParseFloat32Slice(ss []string, def float32) []float32 + func TryParseFloat64(s string, def float64) float64 + func TryParseFloat64Slice(ss []string, def float64) []float64 + func TryParseInt(s string, def int) int + func TryParseInt64(s string, def int64) int64 + func TryParseInt64Slice(ss []string, def int64) []int64 + func TryParseIntSlice(ss []string, def int) []int + func UrlQueryEscape(v interface{}) + func UrlQueryUnescape(v interface{}) + func Validate(v interface{}) (int, string) + func WriteBase64File(filePath string, base64String string) error + func WriteFile(filePath string, content []byte) error + func WriteJsonFile(filePath string, v interface{}) error + func WriteTextFile(filePath string, text string) error + type MutexRegistry struct + func NewMutexRegistry() *MutexRegistry + func (mutexRegistry *MutexRegistry) AllRegistered() map[string]string + func (mutexRegistry *MutexRegistry) IsRegistered(key string) bool + func (mutexRegistry *MutexRegistry) Register(key string) (string, bool) + func (mutexRegistry *MutexRegistry) Unregister(key string, registeredId string) bool + type Semaphore struct + func NewSemaphore(permits int) *Semaphore + func (semaphore *Semaphore) Acquire() + func (semaphore *Semaphore) Available() int + func (semaphore *Semaphore) IsEmpty() bool + func (semaphore *Semaphore) IsFull() bool + func (semaphore *Semaphore) Release() + func (semaphore *Semaphore) TryAcquire() bool + func (semaphore *Semaphore) TryAcquireInDuration(timeout time.Duration) bool + type Task struct + ExecFunc func() int64 + NextExecTimeInSeconds int64 + type ValidateBuilder struct + Errors []ValidateError + func (validateBuilder *ValidateBuilder) AddError(name string, value interface{}, desc string) + func (validateBuilder *ValidateBuilder) Count() int + func (validateBuilder *ValidateBuilder) Desc() string + type ValidateError struct + Desc string + Name string + Value string + type ValidateParam struct + Name string + Params []string + func (validateParam *ValidateParam) GetFloatParam(index int) (float64, bool) + func (validateParam *ValidateParam) GetIntParam(index int) (int64, bool) + func (validateParam *ValidateParam) GetUintParam(index int) (uint64, bool)