Documentation ¶
Index ¶
- func CeilingToDay(t time.Time) time.Time
- func Compute[T comparable, R any](a map[T]R, k T, r0 R, fn func(T, R) R) R
- func DiffDays(st, et time.Time) float64
- func FileExists(fn string) (bool, error)
- func IsWorkingDay(t time.Time) bool
- func LocalDate(year int, month time.Month, day int) time.Time
- func ParseDate(s string, d time.Time) time.Time
- func RecoverAsEleErr[T any](ch chan<- Ele[T])
- func Sha256Salt(s string) string
- func SplitAsInt[T int | int8 | int16 | int32 | int64](s, sep string) []T
- func Sum[T any, R int | int8 | int16 | int32 | int64 | float32 | float64](a []T, r0 R, fn func(T) R) R
- func ToStr(o any, ds string) string
- func Today() time.Time
- func TruncateToDay(t time.Time) time.Time
- type AtomicTime
- type Boolean
- type Ele
- type ISODate
- type RollingFileWriter
- type Set
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compute ¶ added in v0.0.3
func Compute[T comparable, R any](a map[T]R, k T, r0 R, fn func(T, R) R) R
func FileExists ¶ added in v0.0.10
func RecoverAsEleErr ¶
func SplitAsInt ¶
SplitAsInt
Types ¶
type AtomicTime ¶
type AtomicTime struct {
// contains filtered or unexported fields
}
func NewAtomicTime ¶
func NewAtomicTime(t time.Time) *AtomicTime
func (*AtomicTime) CompareAndMax ¶
func (t *AtomicTime) CompareAndMax(oa ...time.Time) bool
func (*AtomicTime) CompareAndMin ¶
func (t *AtomicTime) CompareAndMin(oa ...time.Time) bool
func (*AtomicTime) Time ¶
func (t *AtomicTime) Time() time.Time
type Boolean ¶ added in v0.0.11
func (Boolean) MarshalJSON ¶ added in v0.0.11
func (*Boolean) UnmarshalJSON ¶ added in v0.0.11
type ISODate ¶ added in v0.0.6
func (ISODate) MarshalJSON ¶ added in v0.0.6
func (*ISODate) UnmarshalJSON ¶ added in v0.0.6
type RollingFileWriter ¶ added in v0.0.10
type RollingFileWriter struct { Base string // 日志文件夹。 Prefix string // 日志文件前缀。 // contains filtered or unexported fields }
滚动文件日志记录器。
var ( // 默认的滚动文件日志记录器。 DefaultRollingFileWriter *RollingFileWriter = &RollingFileWriter{ Base: "./log", Prefix: "app", } )
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set 表示一个集合。
func NewSet ¶
func NewSet[T comparable](t ...T) *Set[T]
func (*Set[T]) ContainsAny ¶
type Timestamp ¶ added in v0.0.4
func (Timestamp) MarshalJSON ¶ added in v0.0.4
func (*Timestamp) UnmarshalJSON ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.