ksyncmap

package
v0.0.0-...-456f7df Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ksyncmap : a timeout based syncmap

Index

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
}

KSyncMap is the main struct of timeout based syncmap Data : data syncmap. Timeout : Timeout value UpdateTimestamp store last updatetime, and avoid datamap update freq.

func NewMap

func NewMap(name string, timeout int64, checkfreq int64, verbose bool) *Map

func (*Map) Delete

func (k *Map) Delete(key interface{})

func (*Map) Load

func (k *Map) Load(key interface{}) (value interface{}, ok bool)

func (*Map) Run

func (k *Map) Run()

func (*Map) ShowData

func (k *Map) ShowData()

func (*Map) ShowExpireTime

func (k *Map) ShowExpireTime()

func (*Map) Store

func (k *Map) Store(key interface{}, value interface{}, currentTime time.Time)

func (*Map) UpdateTime

func (k *Map) UpdateTime(key interface{}, currentTime time.Time)

Jump to

Keyboard shortcuts

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