Documentation ¶
Overview ¶
Package tsyncmap : a timeout based syncmap
Index ¶
- type Map
- func (tmap *Map) Delete(key interface{})
- func (tmap *Map) GetRemainTime(key interface{}) (time.Duration, error)
- func (tmap *Map) Load(key interface{}) (value interface{}, ok bool)
- func (tmap *Map) LoadRestApi(w http.ResponseWriter, r *http.Request)
- func (tmap *Map) Run()
- func (tmap *Map) ShowData()
- func (tmap *Map) ShowExpireTime()
- func (tmap *Map) Store(key interface{}, value interface{}, currentTime time.Time)
- func (tmap *Map) UpdateTime(key interface{}, currentTime time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct { Name string Data sync.Map Timeout int64 CheckFreq int64 ExpireTime sync.Map Verbose bool }
Map is the base structure for tsyncmap.
func (*Map) LoadRestApi ¶
func (tmap *Map) LoadRestApi(w http.ResponseWriter, r *http.Request)
func (*Map) Run ¶
func (tmap *Map) Run()
Run is a coroutine to help tsyncmap manage the expire data.
func (*Map) ShowExpireTime ¶
func (tmap *Map) ShowExpireTime()
func (*Map) UpdateTime ¶
UpdateTime is used update specific key's expiretime.
Click to show internal directories.
Click to hide internal directories.