Documentation
¶
Index ¶
- Constants
- func Date() string
- func DateNumber() string
- func DateTime() string
- func DayEndDateTime() string
- func DayEndTime() int64
- func DayStartDateTime() string
- func DayStartTime() int64
- func FormatDatetime(t time.Time) string
- func IsDateFormat(date string) bool
- func IsDateTimeFormat(datetime string) bool
- func Location() *time.Location
- func ParseDateTime(datetime string) time.Time
- func Time() string
- func Unix(t time.Time) int64
- func UnixNow() int64
- type Handler
- type SimpleHandler
- type SimpleTimeWheel
- type TimeWheel
Constants ¶
View Source
const ( DatetimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" DateDayFormat = "20060102" TimeFormat = "15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func DateNumber ¶
func DateNumber() string
func DayEndDateTime ¶
func DayEndDateTime() string
func DayEndTime ¶
func DayEndTime() int64
func DayStartDateTime ¶
func DayStartDateTime() string
func DayStartTime ¶
func DayStartTime() int64
func FormatDatetime ¶
func IsDateFormat ¶
func IsDateTimeFormat ¶
func ParseDateTime ¶
Types ¶
type SimpleHandler ¶
type SimpleHandler[T any] func(*SimpleTimeWheel[T], string, T)
type SimpleTimeWheel ¶
type SimpleTimeWheel[T any] struct { // contains filtered or unexported fields }
func NewSimpleTimeWheel ¶
func NewSimpleTimeWheel[T any](delay time.Duration, numSlot int, handler SimpleHandler[T]) *SimpleTimeWheel[T]
func (*SimpleTimeWheel[T]) Add ¶
func (s *SimpleTimeWheel[T]) Add(key string, value T, delay time.Duration)
func (*SimpleTimeWheel[T]) Remove ¶
func (s *SimpleTimeWheel[T]) Remove(key string)
func (*SimpleTimeWheel[T]) Start ¶
func (s *SimpleTimeWheel[T]) Start()
func (*SimpleTimeWheel[T]) Stop ¶
func (s *SimpleTimeWheel[T]) Stop()
type TimeWheel ¶
type TimeWheel struct {
// contains filtered or unexported fields
}
func NewTimeWheel ¶
Click to show internal directories.
Click to hide internal directories.