Documentation
¶
Index ¶
- Constants
- func IsEmptyTime(t time.Time) bool
- func Md5(str string) string
- func NewRandomBase64(strLen int) string
- func NewRandomHex(strLen int) string
- func SizeToHuman(space int64) string
- func StringToTime(str string) time.Time
- func TimeToString(t time.Time) string
- type JsonTime
- type Map
- func (m *Map[K, V]) CompareAndDelete(key K, old V) (deleted bool)
- func (m *Map[K, V]) CompareAndSwap(key K, old V, new V) (swapped bool)
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) Load(key K) (value V, ok bool)
- func (m *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *Map[K, V]) Range(f func(key K, value V) bool)
- func (m *Map[K, V]) RangeAndCount(f func(key K, value V)) (cnt int)
- func (m *Map[K, V]) Store(key K, value V)
- func (m *Map[K, V]) Swap(key K, value V) (previous V, loaded bool)
Constants ¶
View Source
const ( DefaultTimeFmt = "2006-01-02 15:04:05" StdZeroTimeStr = "0001-01-01 00:00:00" // 标准库里time.Time{} jsonMashal以后的字符串 ZeroTimeStr = "1999-12-31 00:00:00" // 我们自己期望使用的时间 "0" 值字符串 )
Variables ¶
This section is empty.
Functions ¶
func NewRandomBase64 ¶
* @param dataLen: 数据长度,base64膨胀率1.33,返回的string长度是dataLen的1.33倍
func NewRandomHex ¶
func SizeToHuman ¶
Types ¶
type JsonTime ¶
func NewJsonTimeNow ¶
func NewJsonTimeNow() JsonTime
func (JsonTime) MarshalJSON ¶
重写 time.Time 的 MarshalJSON
func (*JsonTime) UnmarshalJSON ¶
重写 time.Time 的 UnmarshalJSON
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Map[K, V]) CompareAndDelete ¶
func (*Map[K, V]) CompareAndSwap ¶
func (*Map[K, V]) LoadAndDelete ¶
func (*Map[K, V]) LoadOrStore ¶
func (*Map[K, V]) RangeAndCount ¶
Click to show internal directories.
Click to hide internal directories.