Documentation ¶
Index ¶
- Constants
- 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
- type 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
- type ValidateBuilder
- type ValidateError
- type ValidateParam
Constants ¶
View Source
const Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const CharactersCN = `` /* 62922-byte string literal not displayed */
View Source
const CharactersLowercase = "abcdefghijklmnopqrstuvwxyz"
View Source
const CharactersUppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const Numbers = "0123456789"
View Source
const NumbersDecimal = "0123456789."
View Source
const NumbersWritten = "0123456789.,"
View Source
const TimeLayoutCnLong = "2006年1月2日 15:04:05"
View Source
const TimeLayoutCnShort = "2006/1/2 15:04:05"
View Source
const TimeLayoutDateCnLong = "2006年1月2日"
View Source
const TimeLayoutDateCnShort = "2006/1/2"
View Source
const TimeLayoutDateDefault = "2006-01-02"
View Source
const TimeLayoutDateSimple = "20060102"
View Source
const TimeLayoutDefault = "2006-01-02 15:04:05"
View Source
const TimeLayoutSimple = "20060102150405"
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
func AESEncrypt ¶
func Base64RandDecode ¶
func Base64RandEncode ¶
func BroadcastEvent ¶
func BroadcastEvent(event string, data interface{})
func CalcFileMD5 ¶
func CalcPageCount ¶
func CalcTextSimilarity ¶
func CheckIPAddressInRange ¶
func ClockToSecond ¶
func CopyStringSlice ¶
func DecodeObfuscatedString ¶
func ExtractChars ¶
func FillBoolSlice ¶
func FillStringSlice ¶
func FilterChars ¶
func FormatDate ¶
func FormatDateCNLong ¶
func FormatDateCNShort ¶
func FormatTime ¶
func FormatTimeCNLong ¶
func FormatTimeCNShort ¶
func Int64ArrayContains ¶
func IntArrayContains ¶
func IsDirExists ¶
func IsFileExists ¶
func NewBoolSlice ¶
func NewStringSlice ¶
func NowDateInMillis ¶
func NowDateInMillis() int64
func NowDateInSeconds ¶
func NowDateInSeconds() int64
func NowDateInSimpleString ¶
func NowDateInSimpleString() string
func NowDateInString ¶
func NowDateInString() string
func NowInClockSpan ¶
func NowInMillis ¶
func NowInMillis() int64
func NowInNanos ¶
func NowInNanos() int64
func NowInSeconds ¶
func NowInSeconds() int64
func NowInSimpleString ¶
func NowInSimpleString() string
func NowInString ¶
func NowInString() string
func ObfuscateString ¶
func RandomString ¶
func RegisterEventReceiver ¶
func RegisterEventReceiver(receiver func(event string, data interface{}))
func RemoveAtStringSlice ¶
func ReplaceSimilarText ¶
func ScheduleTask ¶
func ShuffleRuneArray ¶
func ShuffleRuneArray(input []rune)
func SplitWithoutEmpty ¶
func StringArrayContains ¶
func StringArrayContainsAny ¶
func StringContainsAll ¶
func ToJsonString ¶
func ToJsonString(v interface{}) string
func TryDivideToPercent ¶
func TryParseBool ¶
func TryParseBoolSlice ¶
func TryParseFloat32 ¶
func TryParseFloat32Slice ¶
func TryParseFloat64 ¶
func TryParseFloat64Slice ¶
func TryParseInt ¶
func TryParseInt64 ¶
func TryParseInt64Slice ¶
func TryParseIntSlice ¶
func UrlQueryEscape ¶
func UrlQueryEscape(v interface{})
func UrlQueryUnescape ¶
func UrlQueryUnescape(v interface{})
func WriteBase64File ¶
func WriteJsonFile ¶
func WriteTextFile ¶
Types ¶
type MutexRegistry ¶
type MutexRegistry struct {
// contains filtered or unexported fields
}
func NewMutexRegistry ¶
func NewMutexRegistry() *MutexRegistry
func (*MutexRegistry) AllRegistered ¶
func (mutexRegistry *MutexRegistry) AllRegistered() map[string]string
func (*MutexRegistry) IsRegistered ¶
func (mutexRegistry *MutexRegistry) IsRegistered(key string) bool
func (*MutexRegistry) Register ¶
func (mutexRegistry *MutexRegistry) Register(key string) (string, bool)
func (*MutexRegistry) Unregister ¶
func (mutexRegistry *MutexRegistry) Unregister(key string, registeredId string) bool
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
func NewSemaphore ¶
func (*Semaphore) TryAcquire ¶
type ValidateBuilder ¶
type ValidateBuilder struct {
Errors []ValidateError
}
func (*ValidateBuilder) AddError ¶
func (validateBuilder *ValidateBuilder) AddError(name string, value interface{}, desc string)
func (*ValidateBuilder) Count ¶
func (validateBuilder *ValidateBuilder) Count() int
func (*ValidateBuilder) Desc ¶
func (validateBuilder *ValidateBuilder) Desc() string
type ValidateError ¶
type ValidateParam ¶
func (*ValidateParam) GetFloatParam ¶
func (validateParam *ValidateParam) GetFloatParam(index int) (float64, bool)
func (*ValidateParam) GetIntParam ¶
func (validateParam *ValidateParam) GetIntParam(index int) (int64, bool)
func (*ValidateParam) GetUintParam ¶
func (validateParam *ValidateParam) GetUintParam(index int) (uint64, bool)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.