ttlmap

package
v0.0.0-...-7bb0158 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TTLMap

type TTLMap struct {
	sync.Map //数据真实存储map
	// contains filtered or unexported fields
}

func New

func New(delay time.Duration) *TTLMap

delay time.Duration后删除 > 最少1秒,低于1秒重置为1秒。

func (*TTLMap) GetDelay

func (m *TTLMap) GetDelay() time.Duration

func (*TTLMap) Set

func (m *TTLMap) Set(key, val any)

设置值并保存

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL