Documentation
¶
Index ¶
- Constants
- func Abs(x int) int
- func Abs64(x int64) int64
- func AllZeros(b []byte) bool
- func ByteFlip(b []byte) []byte
- func ByteGT(a, b []byte) bool
- func ByteLT(a, b []byte) bool
- func BytePad(b []byte, size int) []byte
- func BytePadPrefix(b []byte, size int) []byte
- func ByteReverse(d []byte) []byte
- func ByteSliceStrings(b [][]byte) []string
- func ByteUnPad(b []byte) []byte
- func CombineBytes(slices ...[]byte) []byte
- func CopyTimeToDate(src, dst time.Time) time.Time
- func CountMatches(full, part string) int
- func CountMatchesRegex(full, regex string) int
- func DateGTE(a, b time.Time) bool
- func DateLTE(a, b time.Time) bool
- func DateMax(a, b time.Time) time.Time
- func DateMin(a, b time.Time) time.Time
- func FastHash32(s string) []byte
- func FastHash32Uint(s string) uint32
- func FirstDayOfISOWeek(year int, week int) time.Time
- func GetBoolFromString(s string) bool
- func GetByteDuration(b []byte) time.Duration
- func GetByteMd5Int(b []byte) uint
- func GetByteTime(b []byte) time.Time
- func GetByteTimeBig(b []byte) time.Time
- func GetByteTimeNano(b []byte) time.Time
- func GetByteTimeNanoBig(b []byte) time.Time
- func GetDaySeconds(t time.Time) time.Duration
- func GetDaysInMonth(t time.Time) int
- func GetDurationByte(d time.Duration) []byte
- func GetFloatFromString(s string, size int) float64
- func GetInt(data []byte) int
- func GetInt32(data []byte) int32
- func GetInt32Big(data []byte) int32
- func GetInt32Data(i int32) []byte
- func GetInt32DataBig(i int32) []byte
- func GetInt32FromString(s string) int32
- func GetInt64(d []byte) int64
- func GetInt64Big(d []byte) int64
- func GetInt64Data(i int64) []byte
- func GetInt64DataBig(i int64) []byte
- func GetInt64FromString(s string) int64
- func GetIntData(i int) []byte
- func GetIntFromString(s string) int
- func GetIpString(ip net.IP, port uint16) string
- func GetMatches(full, regex string) []string
- func GetSha256Hash(script []byte) []byte
- func GetTime(ts time.Time) string
- func GetTimeAgo(ts time.Time) string
- func GetTimeAgoShort(ts time.Time) string
- func GetTimeByte(t time.Time) []byte
- func GetTimeByteBig(t time.Time) []byte
- func GetTimeByteNano(t time.Time) []byte
- func GetTimeByteNanoBig(t time.Time) []byte
- func GetTimezoneTime(ts time.Time, timezone string) string
- func GetTimezoneTimeShort(ts time.Time, timezone string) string
- func GetUInt16FromString(s string) uint16
- func GetUInt32FromString(s string) uint32
- func GetUInt64FromString(s string) uint64
- func GetUIntFromString(s string) uint
- func GetUint(data []byte) uint
- func GetUint16(data []byte) uint16
- func GetUint16Data(i uint16) []byte
- func GetUint32(data []byte) uint32
- func GetUint32Big(data []byte) uint32
- func GetUint32Data(i uint32) []byte
- func GetUint32DataBig(i uint32) []byte
- func GetUint64(data []byte) uint64
- func GetUint64Data(i uint64) []byte
- func GetUintData(i uint) []byte
- func GetUnique(n int) string
- func GetUniqueHex(n int) string
- func GetUtf8String(data []byte) string
- func HasPrefix(b []byte, prefix []byte) bool
- func InByteArray(needle []byte, haystack [][]byte) bool
- func InIntSlice(needle int, haystack []int) bool
- func InUintSlice(needle uint, haystack []uint) bool
- func IsMatch(full, part string) bool
- func IsMatchRegex(full, regex string) bool
- func IsNil(a interface{}) bool
- func IsTimeZero(t time.Time) bool
- func MaxFloat64(x, y float64) float64
- func MaxInt(x, y int) int
- func MaxInt64(x, y int64) int64
- func MinInt(x, y int) int
- func MinInt64(x, y int64) int64
- func RemoveDupeStrings(stringList []string) []string
- func RemoveDupes(uints []uint) []uint
- func RemoveDupesAndEmpties(data [][]byte) [][]byte
- func Replace(full, regex, replace string) string
- func ReverseString(s string) string
- func ReverseStringSlice(slice []string) []string
- func RoundMonth(t time.Time) time.Time
- func RoundTime(t time.Time, days int) time.Time
- func RoundWeek(t time.Time) time.Time
- func ShortHash(hash string) string
- func ShortHashLen(hash string, prefixSuffixLen int) string
- func StringInSlice(needle string, haystack []string) bool
- func StringsInSlice(needles []string, haystack []string) bool
- func TimeInSlice(item time.Time, times []time.Time) bool
- func TimeRoundSeconds(t time.Time, seconds uint) time.Time
- func UnescapeByteString(s string) []byte
- type Bitwise
- type Catch
- type DateDiff
Constants ¶
View Source
const (
DefaultPrefixSuffixLen = 8
)
Variables ¶
This section is empty.
Functions ¶
func BytePadPrefix ¶
BytePadPrefix will use 2 bytes for prefix, so input data must not be greater than size-2.
func ByteReverse ¶
func ByteSliceStrings ¶
func CombineBytes ¶
func CountMatches ¶
func CountMatchesRegex ¶
func FastHash32 ¶
func FastHash32Uint ¶
func FirstDayOfISOWeek ¶
func GetBoolFromString ¶
func GetByteDuration ¶
func GetByteMd5Int ¶
func GetByteTime ¶
func GetByteTimeBig ¶
func GetByteTimeNano ¶
func GetByteTimeNanoBig ¶
func GetDaysInMonth ¶
func GetDurationByte ¶
func GetFloatFromString ¶
func GetInt32Big ¶
func GetInt32Data ¶
func GetInt32DataBig ¶
func GetInt32FromString ¶
func GetInt64Big ¶
func GetInt64Data ¶
func GetInt64DataBig ¶
func GetInt64FromString ¶
func GetIntData ¶
func GetIntFromString ¶
func GetMatches ¶
func GetSha256Hash ¶
func GetTimeAgo ¶
func GetTimeAgoShort ¶
func GetTimeByte ¶
func GetTimeByteBig ¶
func GetTimeByteNano ¶
func GetTimeByteNanoBig ¶
func GetUInt16FromString ¶
func GetUInt32FromString ¶
func GetUInt64FromString ¶
func GetUIntFromString ¶
func GetUint16Data ¶
func GetUint32Big ¶
func GetUint32Data ¶
func GetUint32DataBig ¶
func GetUint64Data ¶
func GetUintData ¶
func GetUniqueHex ¶
func GetUtf8String ¶
func InByteArray ¶
func InIntSlice ¶
func InUintSlice ¶
func IsMatchRegex ¶
func IsTimeZero ¶
func MaxFloat64 ¶
func RemoveDupeStrings ¶
func RemoveDupes ¶
func RemoveDupesAndEmpties ¶
func ReverseString ¶
func ReverseStringSlice ¶
func ShortHashLen ¶
func StringInSlice ¶
func StringsInSlice ¶
func TimeRoundSeconds ¶
TimeRoundSeconds could use Golang's built-in time.Round function but want to be explicit so easy to replicate in other languages
func UnescapeByteString ¶
Types ¶
type DateDiff ¶
type DateDiff struct { Year int Month int Day int Hour int Min int Sec int // contains filtered or unexported fields }
func GetDateDiff ¶
func (DateDiff) DaysInLastMonth ¶
https://github.com/jinzhu/now/blob/928c32c8eb60e699b591de5911a1c8f50d11d15a/now.go#L44
func (DateDiff) DaysRounded ¶
Click to show internal directories.
Click to hide internal directories.