Documentation ¶
Overview ¶
* @Author: cnzf1 * @Date: 2023-03-28 14:36:32 * @LastEditors: cnzf1 * @LastEditTime: 2023-03-29 13:47:13 * @Description:
Index ¶
- type DelCallBack
- type EMConfig
- type EMOption
- type ExpiredMap
- func (c *ExpiredMap) Clear()
- func (c *ExpiredMap) Close()
- func (c *ExpiredMap) Delete(key string)
- func (c *ExpiredMap) Foreach(fn func(key string, value lang.AnyType))
- func (c *ExpiredMap) Get(key string) (value lang.AnyType, ok bool)
- func (c *ExpiredMap) Set(key string, value lang.AnyType, ttl time.Duration) bool
- func (c *ExpiredMap) Size() int64
- func (c *ExpiredMap) TTL(key string) time.Duration
- type SafeMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DelCallBack ¶
type EMOption ¶
type EMOption func(*EMConfig)
func WithDelCallback ¶
func WithDelCallback(fn DelCallBack) EMOption
type ExpiredMap ¶
type ExpiredMap struct {
// contains filtered or unexported fields
}
func NewExpiredMap ¶
func NewExpiredMap(opts ...EMOption) *ExpiredMap
func (*ExpiredMap) Clear ¶
func (c *ExpiredMap) Clear()
func (*ExpiredMap) Close ¶
func (c *ExpiredMap) Close()
func (*ExpiredMap) Delete ¶
func (c *ExpiredMap) Delete(key string)
func (*ExpiredMap) Size ¶
func (c *ExpiredMap) Size() int64
type SafeMap ¶
type SafeMap struct {
// contains filtered or unexported fields
}
SafeMap provides a map alternative to avoid memory leak. This implementation is not needed until issue below fixed. https://github.com/golang/go/issues/20135
func (*SafeMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Click to show internal directories.
Click to hide internal directories.