Documentation ¶
Index ¶
- Constants
- func Bts2Str(bts []byte) string
- func CheckIfUseLCSByIdc(idc string) bool
- func ConvertToInt64(v interface{}) (int64, error)
- func CopyFile(src, dst string) (err error)
- func CutStringSliceByStep(array []string, step int) (int, [][]string)
- func DGetCurrentTime(layout string) string
- func Dump(fileDir, name string) (*os.File, error)
- func Dup2(from int, to int) error
- func Duration(d int64) time.Duration
- func EnsureDir(dir string) error
- func Exists(p string) bool
- func FatalWithSmsAlert(errMsg string)
- func FixCategoryByIdc(idc, category string) string
- func FromLocalDateToSecond(v string) int64
- func FromSecondToLocalDate(v int64) string
- func FromTime2TimeInt(t time.Time) int
- func FuncName(skip int) string
- func GetCurrentMicrosecond() int64
- func GetCurrentMillisecond() int64
- func GetCurrentNanosecond() int64
- func GetCurrentSecond() int64
- func GetCurrentTime() string
- func HumanSize(s uint64) string
- func Int64ArraySlice(array []int64, offset int, length int) []int64
- func Int64ArrayToString(list []int64, sep string) string
- func IsEmpty(dir string) (bool, error)
- func IsLink(p string) (bool, error)
- func IsSameDay(t1, t2 time.Time) bool
- func IsSameDayWithTimestamp(d1, d2 int64) bool
- func IsTimeoutError(err error) bool
- func ListDir(dir string) ([]string, error)
- func LoadJsonToObject(filename string, t interface{}) error
- func Marshal(v interface{}) ([]byte, error)
- func MustFloat64(v interface{}, defaultValue float64) float64
- func MustInt64(v interface{}, defaultValue int64) int64
- func MustInt64Array(v interface{}, defaultValue []int64) []int64
- func MustString(v interface{}, defaultValue string) string
- func MustStringArray(v interface{}, defaultValue []string) []string
- func ParseMemorySize(size string) (uint64, error)
- func PathExists(path string) bool
- func RandString(n int) string
- func ReviewDumpPanic(file *os.File) error
- func SafeSprintf(format string, args ...interface{}) string
- func Sleep(millisecond int64)
- func SliceCutter(v interface{}, maxsize int) ([]interface{}, error)
- func SplitTimeInt(t int) (year, month, day int)
- func Store2File(file string, content string) error
- func Str2Bts(str string) []byte
- func StringArraySlice(array []string, offset int, length int) []string
- func StringInSlice(a []string, s string) bool
- func StringStringMap2StringInterfaceMap(input map[string]string) map[string]interface{}
- func TraceId() string
- func TryString(v interface{}) (string, bool)
- func WithRecover(fn func(), errHandler func(interface{})) (err interface{})
Constants ¶
View Source
const ( Nanosecond = int64(time.Nanosecond) // Nanosecond Microsecond = 1000 * Nanosecond // Nanosecond Millisecond = 1000 * Microsecond // Nanosecond Second = 1000 * Millisecond // Nanosecond Minute = 60 * Second // Nanosecond Hour = 60 * Minute // Nanosecond Day = 24 * Hour // Nanosecond Year = 365 * Day // Nanosecond SecondsPerYear = Year / Second // Second SecondsPerDay = Day / Second // Second SecondsPerHour = Hour / Second // Second SecondsPerMinute = Minute / Second // Second MillisecondsPerYear = Year / Millisecond // Millisecond MillisecondsPerDay = Day / Millisecond // Millisecond MillisecondsPerHour = Hour / Millisecond // Millisecond MillisecondsPerMinute = Minute / Millisecond // Millisecond MillisecondsPerSecond = Second / Millisecond // Millisecond MicrosecondsPerYear = Year / Microsecond // Microsecond MicrosecondsPerDay = Day / Microsecond // Microsecond MicrosecondsPerHour = Hour / Microsecond // Microsecond MicrosecondsPerMinute = Minute / Microsecond // Microsecond MicrosecondsPerSecond = Second / Microsecond // Microsecond MicrosecondsPerMillisecond = Millisecond / Microsecond // Microsecond )
Variables ¶
This section is empty.
Functions ¶
func ConvertToInt64 ¶
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. copy the file contents from src to dst.
func CutStringSliceByStep ¶
return subslice count and subslices
func DGetCurrentTime ¶
func FatalWithSmsAlert ¶ added in v1.6.6
func FatalWithSmsAlert(errMsg string)
func FixCategoryByIdc ¶
LCS服务为防止无法寻找到topic,需要对category添加前缀
func FromLocalDateToSecond ¶
func FromSecondToLocalDate ¶
func FromTime2TimeInt ¶
func GetCurrentMicrosecond ¶
func GetCurrentMicrosecond() int64
func GetCurrentMillisecond ¶
func GetCurrentMillisecond() int64
func GetCurrentNanosecond ¶
func GetCurrentNanosecond() int64
func GetCurrentSecond ¶
func GetCurrentSecond() int64
func GetCurrentTime ¶
func GetCurrentTime() string
func Int64ArrayToString ¶
func IsSameDayWithTimestamp ¶
func IsTimeoutError ¶ added in v1.6.6
func LoadJsonToObject ¶
func MustFloat64 ¶
func MustInt64Array ¶
func MustString ¶
func MustStringArray ¶
func PathExists ¶
func RandString ¶
func ReviewDumpPanic ¶
func SafeSprintf ¶
func SliceCutter ¶
func SplitTimeInt ¶
func Store2File ¶
func StringInSlice ¶ added in v1.6.6
func StringStringMap2StringInterfaceMap ¶
This is a safe convert since string can always convert to interface{}
func WithRecover ¶
func WithRecover(fn func(), errHandler func(interface{})) (err interface{})
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.