mapWithExpiry

package
v1.247349.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapWithExpiry

type MapWithExpiry struct {
	// contains filtered or unexported fields
}

MapWithExpiry act like a map which provide a method to clean up expired entries

func NewMapWithExpiry

func NewMapWithExpiry(ttl time.Duration) *MapWithExpiry

func (*MapWithExpiry) CleanUp

func (m *MapWithExpiry) CleanUp(now time.Time)

func (*MapWithExpiry) Delete added in v1.247346.0

func (m *MapWithExpiry) Delete(key string)

func (*MapWithExpiry) Get

func (m *MapWithExpiry) Get(key string) (interface{}, bool)

func (*MapWithExpiry) Set

func (m *MapWithExpiry) Set(key string, content interface{})

func (*MapWithExpiry) Size

func (m *MapWithExpiry) Size() int

Jump to

Keyboard shortcuts

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