Documentation ¶
Index ¶
- func Async() *async
- func Convert[E1, E2 any](src E1, des E2) error
- func FilterFunc[E any](s []E, f func(e E) bool) []E
- func FilterParallelFunc[E any](s []E, f func(e E) bool) ([]E, error)
- func FindFunc[E any](s []E, f func(e E) bool) (E, bool)
- func GroupFunc[E any, K comparable](s []E, f func(e E) K) map[K][]E
- func LoopAsyncFunc[E any](s []E, f func(e E), wait bool) error
- func LoopFunc[E any](s []E, f func(e E))
- func LoopParallelFunc[E any](s []E, f func(e E)) error
- func LoopWithIndexAsyncFunc[E any](s []E, f func(e E, i int), wait bool) error
- func LoopWithIndexFunc[E any](s []E, f func(e E, i int))
- func LoopWithIndexParallelFunc[E any](s []E, f func(e E, i int)) error
- func MapFunc[E1, E2 any](s []E1, f func(e E1) E2) []E2
- func MapParallelFunc[E1, E2 any](s []E1, f func(e E1) E2) ([]E2, error)
- func Pointer[E any](v E) *E
- func PointerMap[E any](vs map[string]E) map[string]*E
- func PointerSlice[E any](vs []E) []*E
- func Random(length uint) string
- func RandomNumber(length uint) string
- func RandomSpecial(length uint) string
- func RandomString(length uint) string
- func ReduceFunc[E1, E2 any](s []E1, a E2, f func(a E2, e E1) E2) E2
- func SliceToMapFunc[E any, K comparable](s []E, f func(e E) K) map[K]E
- func UniqueFunc[E any, K comparable](s []E, f func(e E) K) []E
- func Value[E any](p *E) E
- func ValueMap[E any](ps map[string]*E) map[string]E
- func ValueSlice[E any](ps []*E) []E
- type CacheConfig
- type CacheShard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterFunc ¶
func FilterParallelFunc ¶ added in v1.0.21
func GroupFunc ¶ added in v1.0.21
func GroupFunc[E any, K comparable](s []E, f func(e E) K) map[K][]E
func LoopAsyncFunc ¶ added in v1.0.21
func LoopParallelFunc ¶ added in v1.0.23
func LoopWithIndexAsyncFunc ¶ added in v1.0.26
func LoopWithIndexFunc ¶ added in v1.0.26
func LoopWithIndexParallelFunc ¶ added in v1.0.26
func MapParallelFunc ¶ added in v1.0.21
func PointerMap ¶ added in v1.0.11
func PointerSlice ¶ added in v1.0.11
func PointerSlice[E any](vs []E) []*E
func RandomNumber ¶
func RandomSpecial ¶
func RandomString ¶
func ReduceFunc ¶
func ReduceFunc[E1, E2 any](s []E1, a E2, f func(a E2, e E1) E2) E2
func SliceToMapFunc ¶ added in v1.0.21
func SliceToMapFunc[E any, K comparable](s []E, f func(e E) K) map[K]E
func UniqueFunc ¶
func UniqueFunc[E any, K comparable](s []E, f func(e E) K) []E
func ValueSlice ¶ added in v1.0.11
func ValueSlice[E any](ps []*E) []E
Types ¶
type CacheConfig ¶ added in v1.0.10
type CacheShard ¶ added in v1.0.4
type CacheShard[E any] []*cache[E]
func NewCacheShard ¶ added in v1.0.4
func NewCacheShard[E any](config ...CacheConfig) CacheShard[E]
func (CacheShard[E]) Delete ¶ added in v1.0.10
func (s CacheShard[E]) Delete(key string) error
func (CacheShard[E]) Get ¶ added in v1.0.4
func (s CacheShard[E]) Get(key string) (E, error)
func (CacheShard[E]) Keys ¶ added in v1.0.13
func (s CacheShard[E]) Keys() []string
func (CacheShard[E]) Reset ¶ added in v1.0.10
func (s CacheShard[E]) Reset() error
func (CacheShard[E]) Set ¶ added in v1.0.4
func (s CacheShard[E]) Set(key string, val E, exp time.Duration) error
func (CacheShard[E]) Values ¶ added in v1.0.13
func (s CacheShard[E]) Values() []E
Click to show internal directories.
Click to hide internal directories.